These are chat archives for AvaloniaUI/Avalonia

3rd
Nov 2016
Darnell Williams
@Seeker1437
Nov 03 2016 01:40
Ah yeah
The second on lost resolutions i have a bigger one
@grokys for the first one if you focus on the results view, item 0 is the Carousel's Gird, somehow it it not part of the root visual tree.
Darnell Williams
@Seeker1437
Nov 03 2016 01:45
Et me just cooypaste instead
This is the second image at the normal size
When he adds the TextEditor (quoted when it attaches it looks like the second image)
The VisualAccessor work properly
But when detached the accessor looks different:
Darnell Williams
@Seeker1437
Nov 03 2016 01:54

Direct Quote:

If I have

<Root
<Carousel
    <Grid
      <DockControl
         <Branck
            <FirstItem
               <TextEditor

Then remove the <TextEditor

<Grid becomes the closest accessor to Carousel then there is no path to root and it crashes

Steven Kirk
@grokys
Nov 03 2016 10:22
hey @SuperJMN
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:23
hi! wherever you want to chat!
hello everybody!
Steven Kirk
@grokys
Nov 03 2016 10:25
ok! (continuing a private conversation here)
ok, so StyleInclude is a bit like the Resources.MergedDictionaries in WPF
so you can do something like:
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:25
OK
Steven Kirk
@grokys
Nov 03 2016 10:25
<Application xmlns="https://github.com/avaloniaui">
  <Application.Styles>
    <StyleInclude Source="resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"/>
    <StyleInclude Source="resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"/>
  </Application.Styles>
</Application>
that loads a style into the Application.Styles collection from an external XAML file
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:27
you mean a bunch of Styles?
Steven Kirk
@grokys
Nov 03 2016 10:27
well yeah that example loads 2 styles
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:27
Each StyleInclude merges all the styles in the Source, doest't it?
<StyleInclude Source="resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"/>
takes all the styles into DefaultTheme.xaml?
Steven Kirk
@grokys
Nov 03 2016 10:29
yeah, a Style can actually be a collection of styles
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:29
OK, and the resm: prefix?
Steven Kirk
@grokys
Nov 03 2016 10:29
but yeah it imports all styles in DefaultTheme.xaml into Application.Styles
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:29
loads from resources?
Steven Kirk
@grokys
Nov 03 2016 10:29
resm: is to load manifest resources, yeah
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:30
is the path relative?
Steven Kirk
@grokys
Nov 03 2016 10:30
well this is where the problem comes in
if i say <StyleInclude Source="resm:ControlCatalog.SideBar.xaml"/>
which assembly do i try to load that resource from?
it has to be relative to the XAML file in which the <StyleInclude> appears
and to know that I need to know the URL of the XAML file being parsed
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:32
Idea!
<StyleInclude Source="{RelativePath blablabla }" />
and you've got it!
the extension can easily find the relative path using the ParsingDictionary
Steven Kirk
@grokys
Nov 03 2016 10:34
yeah that could work, but it's not really ideal imo
we will need the same thing for bitmaps etc too
and i'd prefer to just be able to give the relative URL
because that's how it works in every other XAML framework
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:35
the bad thing is that OmniXAML doesn't deal with any kind of URLs
apart from namespaces, that are mandatory for XML parsing
so it doesn't know where the XAML comes from
Steven Kirk
@grokys
Nov 03 2016 10:36
how would you do this with System.Xaml?
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:38
I don't know exactly :(
Steven Kirk
@grokys
Nov 03 2016 10:38
it's definitely a feature that is needed in XAML
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:38
Uhmmm, maybe it's a type converter feature
Steven Kirk
@grokys
Nov 03 2016 10:39
any kind of markup that loads any kind of resource that can be relative will need to know what the resource being loaded is relative to
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:39
when you do <Image Source=""> the string is converted to an Uri, via TypeConverter
Steven Kirk
@grokys
Nov 03 2016 10:39
ah yeah true
i guess we could do that here!
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:40
so, maybe WPF, for instance, is only using an already existing feature: TypeConverter can access the parsing dictionary
yes, could you make that work??
Steven Kirk
@grokys
Nov 03 2016 10:40
i guess StyleInclude.Source could use a different type other than Uri
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:40
or maybe there could be an UriConverter
that provides the correct value in runtime
Steven Kirk
@grokys
Nov 03 2016 10:41
hmm yeah true!
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:41
does it make sense?
Steven Kirk
@grokys
Nov 03 2016 10:41
yeah i think so!
i can try it later
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:41
I remember that WPF did something like that
Steven Kirk
@grokys
Nov 03 2016 10:42
that sounds like that might be a good solution
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:42
I personally think that XAML should be as Uri agnostic as it can
Steven Kirk
@grokys
Nov 03 2016 10:42
oh i agree - but it has to at least be aware that Urls are being used
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:42
yes, and that can be done inside the 2 extension points we have!
MarkupExtensions and TypeConverters are our rescuers!
Steven Kirk
@grokys
Nov 03 2016 10:43
so we already have a UriTypeConverter
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:43
as soon as you have that, I think I can continue integrating OmniXAML v2 :D
Steven Kirk
@grokys
Nov 03 2016 10:44
btw will omnixaml 2 use System.ComponentModel.TypeConverter?
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:44
I'm really busy with my daily work right now, but I hope this easy enough to dedicate my weekend to it
It can use them!
I thought of simplifying the conversion
and type converters right now are a lambda expression!
Steven Kirk
@grokys
Nov 03 2016 10:45
excellent
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:45
taking string, Context and returning an object
something like Func<string, ValueContext, object> converter
Steven Kirk
@grokys
Nov 03 2016 10:46
because the type converter registry we have at the moment means that 3rd party components can't add their own
so if we could use System.ComponentModel.TypeConverter that would be great
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:46
it's not difficult to adapt the mechanism to anything we need
Steven Kirk
@grokys
Nov 03 2016 10:47
ok, i need to go for 30 mins now
speak later
José Manuel Nieto
@SuperJMN
Nov 03 2016 10:47
OK! see you!
Check that: the context given in a TypeConverter is as awful as hitting your father with a sweated sock
Steven Kirk
@grokys
Nov 03 2016 11:26
man we need something like that though for the designer!
José Manuel Nieto
@SuperJMN
Nov 03 2016 11:27
ouh mamma
what do you need from it?
it smells really bad
Darnell Williams
@Seeker1437
Nov 03 2016 11:29
This is cool, why is ii ss smelly? Is it godly or something?
Steven Kirk
@grokys
Nov 03 2016 11:39
yeah i don't understand what's so bad about it
maybe i've misunderstood what it does though - what is it for?
José Manuel Nieto
@SuperJMN
Nov 03 2016 11:45
well, in a TypeConverter, when you call ConvertTo(ITypeDescriptorContext context...) the context your are provided is open, you don't know what to expect from it
you blindly call to GetService to get a service that may or may not be there
it's like using "object" references all the way, and casting to each type when you need it
it doesn't look like a true modeled interface, but it's open instead. So open it can have anything inside
Darnell Williams
@Seeker1437
Nov 03 2016 11:49
Ah yeah, but if we do it how we did the AvaloniaProperties (where it has the actual type and I don't have to cast) it can be made better
José Manuel Nieto
@SuperJMN
Nov 03 2016 11:49
yes, that's what I'm doing right now
a context, but with a set of predefined contents
Darnell Williams
@Seeker1437
Nov 03 2016 11:50
Im excited for that then :D also thanks for fixing the issue ;)
Where the missing } wasnt caught
José Manuel Nieto
@SuperJMN
Nov 03 2016 11:51
don't say that! it took ages for me to focus
I finally have some time to dedicate to OmniXAML :)
Darnell Williams
@Seeker1437
Nov 03 2016 12:41
Wut you helped lol
Andrey Kunchev
@donandren
Nov 03 2016 16:14
@grokys had some time to check #633 and it looks like it's only partially fixed. I've added comments to the PR with unit test #642 and #633
Steven Kirk
@grokys
Nov 03 2016 16:38
thanks @donandren
will take a look
Darnell Williams
@Seeker1437
Nov 03 2016 21:35
Have you guys heard about ggitles?
.....
F*g phone!!
GITLESS