Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:26
    maxkatz6 edited #6087
  • 02:22
    maxkatz6 edited #6087
  • 02:22
    maxkatz6 edited #6087
  • 02:22
    maxkatz6 labeled #6087
  • 02:22
    maxkatz6 opened #6087
  • 02:04
    maxkatz6 commented #6086
  • 02:03
    maxkatz6 commented #6086
  • 02:03
    maxkatz6 commented #6086
  • 02:02
    maxkatz6 labeled #6086
  • 02:02
    maxkatz6 edited #6086
  • 02:01
    maxkatz6 commented #6086
  • 01:48
    Royce551 commented #6086
  • 01:23
    maxkatz6 commented #6086
  • 00:57
    Royce551 labeled #6086
  • 00:57
    Royce551 opened #6086
  • Jun 16 22:03
    maxkatz6 labeled #6081
  • Jun 16 22:03
    maxkatz6 unlabeled #6081
  • Jun 16 22:03
    maxkatz6 commented #6081
  • Jun 16 19:58
    AnonymousWalker edited #6085
  • Jun 16 19:56
    AnonymousWalker commented #5273
Kao
@Shidesu_gitlab
that's a nightmare
Omer
@omerfarukz
it seems you have to set mainscheduler after DI
Kao
@Shidesu_gitlab
@omerfarukz hi Omer, thanks for the answer, could you elaborate just a bit on this?
check it out
YTN0
@YTN0
Anyone know how I can make the scrolbar thumb control wider? Changing the scrollbar width does not change the thumb control size, which is odd... so if you have a wide scrollbar, the thumb control remains tiny
1 reply
luckydbl
@luckydbl
有没有大佬遇到过openfiledialog打不开的问题啊

public async Task GetPath()
{
var dialog = new OpenFileDialog();
dialog.Filters.Add(new FileDialogFilter() { Name = "Text", Extensions = { "txt" } });
dialog.AllowMultiple = true;

var result = await dialog.ShowAsync();
}
在awat那里就出不来了,这个问题困扰了我好久了,我们组有三个同事能打开,另外4个同事打不开,我的有时候能打开,电脑重启后又打不开了,时好时坏,我们的工作机都是不联网的,是不是avalonia的重大bug?

luckydbl
@luckydbl
I can't get out of awat. This problem has bothered me for a long time. Three colleagues in our group can turn it on, and the other four colleagues can't turn it on. Sometimes my computer can turn it on, and it can't turn it on again after the computer restarts. Sometimes it's good and sometimes it's bad. Our working machines are not connected to the Internet. Is it a major bug of Avalonia?
7 replies
GeoTox
@GeoTox

Guys, I know, it's probably the wrong place to ask this, but maybe you might have faced the same problems and know the answers.
I'm using Avalonia MessageBox (https://github.com/AvaloniaUtils/MessageBox.Avalonia/). I have two questions.
1) Is it possible to center button texts? (Fluent theme). They are now aligned to the left side.
2) When there're multiple lines in the messagebox text, the lower part of the last line gets cut.

Anyone can give me some hints to fix this?

CreateLab
@CreateLab

Guys, I know, it's probably the wrong place to ask this, but maybe you might have faced the same problems and know the answers.
I'm using Avalonia MessageBox (https://github.com/AvaloniaUtils/MessageBox.Avalonia/). I have two questions.
1) Is it possible to center button texts? (Fluent theme). They are now aligned to the left side.
2) When there're multiple lines in the messagebox text, the lower part of the last line gets cut.

Anyone can give me some hints to fix this?

hey i'm owner
1) i'll check
2) know this bug will fix in weekends (now you may put new line after your text)
if u need more support it'll be good idea to find me in telegramm avalonia community (https://t.me/AvaloniaRU)

GeoTox
@GeoTox
Thanks man, much appreciated!
hypervtechnics
@hypervtechnics
grafik.png
Hi guys. I have a question regarding controls. I found the hierarchy from the docs. Is it possible that I can present data the way the class hierarchy in the docs does?
Omer
@omerfarukz
I am looking for an example usage of Notification control
olliholliday
@olliholliday
I'm having trouble trying to get a usercontrol to preview properly - is there a way to specify a design time data context? i've tried Design.DataContext but i just get "value cannot be null (parameter name 'source')"
Miha Markič
@MihaMarkic
is there a simple sample how does one bind TabControl.Items property? I mean I can bind it, but tabitems won't appear
Tried something like
<TabControl.ItemTemplate>
      <DataTemplate>
        <TabItem>
          <TabItem.Header>
            <TextBlock VerticalAlignment="Center" Text="XXX" />
          </TabItem.Header>
          <TextBlock Background="Red" >Tubo</TextBlock>
        </TabItem>
      </DataTemplate>
    </TabControl.ItemTemplate>
Miha Markič
@MihaMarkic
Nevermind, I found out that my Items binding wasn't correct - all good
Miha Markič
@MihaMarkic
Looks like I'm able to set header with
<TabControl.ItemTemplate>
      <DataTemplate>
        <TextBlock VerticalAlignment="Center" Text="{Binding Path}" />
      </DataTemplate>
    </TabControl.ItemTemplate>
but the tabitem content is a sibling of TabItem instead of its child for some reason
any idea why?
Steven Kirk
@grokys
you might need to set the HeaderTemplate not ItemTemplate?
VisualMelon
@VisualMelon
Would a PR allowing https://github.com/AvaloniaUI/Avalonia/blob/7842883961d094e08e9def7f30cf32fd573179c7/src/Avalonia.Controls/ItemsControl.cs#L375 to permit an IEnumerable be welcome? Took me a while to work out why a custom implementation of INotifyCollectionChanged wasn't getting along with TreeView: everything was fine except that the :empty psuedo class was always applied when the collections changed (fine when first presented; everything becomes :empty on any change). Issue was resolved by implementing ICollection on the custom collection; allowing IEnumerable would see it consistent with SubscribeToItemsand the initial presentation. (Need to dash now, but happy to discuss further later today/whenever)
Steven Kirk
@grokys
yeah i think that would be acceptable @VisualMelon
though note that if you don't implement IList on your notifying collection, then things are likely to break anyway
unfortunately .NET's collection classes are a bit of a mess and IList is the only real interface we can rely on
VisualMelon
@VisualMelon
@grokys Ah, I'll take a closer look at that assumption then (this is the first time I've had any problem with it); I don't want to expose IList because it's an immutable view, and ItemsCollection seems to fall-back to IEnumerable in other places (e.g. IndexOf, UpdateItemCount), so I figured that was a reasonable minimum interface
Miha Markič
@MihaMarkic

you might need to set the HeaderTemplate not ItemTemplate?

Sadly, there is no HeaderTemplate. However, ItemTemplate acts like a HeaderTemplate if I'm not mistaken.

Steven Kirk
@grokys
oh damn, i could have sworn there was. but TabControl wasn't one of my controls so i'm not so familar with it. @Gillibald will probably know
@VisualMelon yeah it probably won't cause you any problems immediately but might in future versions
basically it would make sense to implement IReadOnlyList for read-only collections but there's no non-generic version of that interface
given that, there's no way to represent an indexable read-only list that supports reference and value types
the closest there is is IList with IsReadOnly == true
VisualMelon
@VisualMelon
Is there a particular reason why IEnumerable as a fall-back would be problematic (other than maintenance overhead, and lack of efficiency in indexing)?
(wondering if I'm missing something)
Steven Kirk
@grokys
yes, 2 problems: 1) there's no way to tell whether an IEnumerable is a collection or a generator 2) no way to index into elements of it
one of our oldest open issues is around this: AvaloniaUI/Avalonia#54
the solution to that issue (as mentioned there) is ItemsSourceView from UWP
however that class needs to query an IEnumerable to see if it has the capabilties it needs
so what it does is check for IList: if it's an IList then it uses the collection directly
if it's not then it copies the items into an IList, meaning that INCC won't work (as we're working on a different list)
hope that makes sense
Steven Kirk
@grokys
ICollection doesn't buy us anything over IList because 1) pretty much all collections which implement ICollection also implement IList and 2) we really need that indexer!
VisualMelon
@VisualMelon
Yeah, all makes sense, and thanks for the extra info: I didn't consider generators as a concern. I'll take a closer look, and might ping you again if I think I can propose a sensible solution. If you think relying on IEnumerable would be brittle, then perhaps it would be better to fail quickly in that case
Steven Kirk
@grokys
yeah probably
we should probably throw if a collection implements INCC but not IList
VisualMelon
@VisualMelon
(I should look at the history of the other fall-backs, since I'm guessing I'm not the first person to suggest them)
Steven Kirk
@grokys
fun fact: you probably know that List implements IList (and by extension ICollection)