These are chat archives for AvaloniaUI/Avalonia

23rd
Aug 2018
jb817566
@jb817566
Aug 23 2018 02:28
Hey whatsup
cm4ker
@cm4ker
Aug 23 2018 09:54
Hi! Does anyone can explain why AvaloniaUI using own implementation of XmlnsDefinitionAttribute instead Portable.Xaml?
Nicolas Musset
@Kryptos-FR
Aug 23 2018 10:15
@wieslawsoltes good find :grin: . It's just a POC though. I still haven't started to use Avalonia: bunch of issues to fix on other libraries unfortunately.
And I'll probably need your dock control and behaviors libraries.
Wiesław Šoltés
@wieslawsoltes
Aug 23 2018 10:24
Good luck with the library fixes :smile: let me know if you need help with Dock control, it's a bit different than WPF one.
The behaviors library is same as WPF/UWP
Steven Kirk
@grokys
Aug 23 2018 10:29
@cm4ker because we didn't want a dependency on portable.xaml in the core libraries
cm4ker
@cm4ker
Aug 23 2018 10:36
@grokys I'm now trying to implement AvaloniaObjectToXmlWriter and I have some problems in namespace resolving... I using standard XamlSchemaContext but it haven't virtual members for overriding namespace resolving and after handling simple object I have this XAML
<Window Height="400" Width="300" xmlns="clr-namespace:Avalonia.Controls;assembly=Avalonia.Controls">
    <Window.Content>
        <StackPanel Orientation="Vertical">
            <StackPanel.Children>
                <TextBox Height="28" Width="100" Text="{Binding Path=Person}" />
                <TextBlock Text="Label component" />
                <CheckBox Content="Checkbox component" />
                <Button Content="Button component" />
                <ObjectPicker xmlns="clr-namespace:ZenPlatform.Controls.Avalonia;assembly=ZenPlatform.Controls.Avalonia" />
                <DataGrid xmlns="clr-namespace:Avalonia.Controls;assembly=Avalonia.DataGrid">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Test" />
                    </DataGrid.Columns>
                </DataGrid>
                <TabControl>
                    <TabControl.Items>
                        <TabItem Header="Page 1">
                            <TabItem.Content>
                                <TextBlock Text="This is content on page 1" />
                            </TabItem.Content>
                        </TabItem>
                        <TabItem Header="Page 2">
                            <TabItem.Content>
                                <TextBlock Text="This is content on page 2" />
                            </TabItem.Content>
                        </TabItem>
                    </TabControl.Items>
                </TabControl>
            </StackPanel.Children>
        </StackPanel>
    </Window.Content>
</Window>
All right but... Then I try to load the XAML I have exception related to Text="{Binding Path=Person}"
I'm investigate the problem
And I found what the XamlSchemaContext scannig assemblies and filling internal props related to resolving the xmlns, but It search XmlnsDefinitionAttribute in Portable.Xaml
Steven Kirk
@grokys
Aug 23 2018 10:45
@cm4ker hmm, i'm not so familar with the XAML stuff to be honest. but can you give me some background? what are you trying to do?
cm4ker
@cm4ker
Aug 23 2018 11:41
I want generate xaml, generate object aka DataContext, send it to the another application parse xaml to object, assign my generated object to the data context and show form
AvaloniaUI have tools for parsing but not for writing
And I'm trying to close this part by using Portable.Xaml
Benedikt Schroeder
@Gillibald
Aug 23 2018 11:57
@jkoritzinsky Just created an issue for the code generation that is missing sharpdx/SharpDX#1067
ahopper
@ahopper
Aug 23 2018 11:58
@cm4ker what advantage does this have over normal xml or json serialization? Are you effectively sending views over the wire? Just intrigued.
Benedikt Schroeder
@Gillibald
Aug 23 2018 11:59
    <Style Selector="TabControl[TabStripPlacement=Top] /template/ #PART_ItemsPresenter">
        <Setter Property="DockPanel.Dock" Value="Top"/>
    </Style>
@grokys Should a change to TabStribPlacement trigger this style?
Steven Kirk
@grokys
Aug 23 2018 11:59
it should, yes
@cm4ker ah ok, yes, XAML writing is something i don't think we've started on really
i think @wieslawsoltes has a bit of experience in this area however
Benedikt Schroeder
@Gillibald
Aug 23 2018 12:01
Sadly it doesn't maybe I am doing something wrong. The initial value always triggers the correct style but changes to that property have no effect. Maybe this is related to the DynamicResource issue.
I have taken your demo code that you had in your TabControl PR and only changes to TabStripPlacement aren't working.
cm4ker
@cm4ker
Aug 23 2018 12:08
@ahopper I need to restore window on remote client and change state of view on remote and local machine. I thought working with xaml is the easiest way to reach it. But now I think it not possible.
danwalmsley
@danwalmsley
Aug 23 2018 12:10
@cm4ker perhaps serializing some model over wire and then binding that model. To ui state?
Wiesław Šoltés
@wieslawsoltes
Aug 23 2018 12:14
@cm4ker Xaml writing is hard especially for such complex data model as AvaloniaUI, I have Xaml writer for much simpler data model and has plenty issue
Portable.Xaml has built-in Xaml writer
Steven Kirk
@grokys
Aug 23 2018 12:18
@Gillibald hmm ok, it sounds like something is broke then :( we do have (very few) tests for selectors with properties in them : https://github.com/AvaloniaUI/Avalonia/blob/master/tests/Avalonia.Styling.UnitTests/SelectorTests_PropertyEquals.cs
perhaps the problem is with enum values? you might want to add a test to check if that's broken
if so, i will try to fix asap
if not, i can investigate but will probably be next week
cm4ker
@cm4ker
Aug 23 2018 12:20
@danwalmsley for example: you push and hold the button and I see this. I have the same form
Benedikt Schroeder
@Gillibald
Aug 23 2018 12:20
Will have a deeper look at it
Writing some tests for that specific scenario makes sense
cm4ker
@cm4ker
Aug 23 2018 12:21
@wieslawsoltes Thank you, but I tryed to use Portable.Xaml writer and it have issues with Avalonia's xmlns
Thanks to all. I think I found the solution of my problem
Joshua Kornblum
@jkornblum
Aug 23 2018 14:01
Hello, is the source for http://avaloniaui.net opensource or on GitHub?
I see https://github.com/AvaloniaUI/avaloniaui.github.io but it doesn't appear to be the same from first glance.
How can I contribute to docs for http://avaloniaui.net, thanks!
Jumar Macato
@jmacato
Aug 23 2018 14:07
@jkornblum just push some PR on the avaloniaui.net github repo, we havent updated the website in a while
Joshua Kornblum
@jkornblum
Aug 23 2018 14:08
Jumar Macato
@jmacato
Aug 23 2018 14:08
the github repo is ahead of the website
ah wait
you linked the wrong repo
Joshua Kornblum
@jkornblum
Aug 23 2018 14:09
Whoops I see it now, I just missed it before
Jumar Macato
@jmacato
Aug 23 2018 14:10
there! I got a bit confused haha
but yeah, just push the changes there then i'll review them afterwards :)
Joshua Kornblum
@jkornblum
Aug 23 2018 14:12
Okay no problem thanks!