These are chat archives for AvaloniaUI/Avalonia

24th
Dec 2018
Valters
@FaithLV
Dec 24 2018 09:19
hey, how do i get UserControls to work? I have an object which inherits UserControl but doesn't render any children added to it.
Somewhat like this
The basic idea is to have Children property and assign it to the value of Children property of the panel inside your control
Valters
@FaithLV
Dec 24 2018 09:30
Visual or logical children?
Nikita Tsukanov
@kekekeks
Dec 24 2018 09:34
I think added controls would be treated as logical children of the Panel
Nikita Tsukanov
@kekekeks
Dec 24 2018 09:58
If you want proper children management you probably need to use actual control templates instead of UserControl
Valters
@FaithLV
Dec 24 2018 10:00
Nah, I just want a control with an image and textblock.
Nikita Tsukanov
@kekekeks
Dec 24 2018 10:01
What's the problem then?
Valters
@FaithLV
Dec 24 2018 10:04
I'm just trying to understand what you linked. Basically, I'm trying to create a control that'll represent a game in UI (with boxart and game title on top of it) then attaching some data model to it for actual data.
Nikita Tsukanov
@kekekeks
Dec 24 2018 10:05
Then you probably just need some xaml with codebehind
Valters
@FaithLV
Dec 24 2018 10:08
got it working! thank you! setting the children property did the trick
<3
Valters
@FaithLV
Dec 24 2018 11:32
i think i already know the answer to the next one, but just to be sure, there's nothing like MaterialDesignInXaml for avalonia, right?
ahopper
@ahopper
Dec 24 2018 11:33
there are material design icons here https://github.com/ahopper/Avalonia.IconPacks
Valters
@FaithLV
Dec 24 2018 11:35
this will be handy, thanks!
MonkAlex
@MonkAlex
Dec 24 2018 16:11
@ahopper what about license on icons?
ahopper
@ahopper
Dec 24 2018 16:16
As far as I know there is not an issue here, most of them come from https://github.com/MahApps/MahApps.Metro.IconPacks
MonkAlex
@MonkAlex
Dec 24 2018 16:19
thanks
CtrlShiftEscape
@CtrlShiftEscape
Dec 24 2018 17:48
Designer crashes when I define Click in XAML, but it works when I start the app
Designer process crashed
Portable.Xaml.XamlObjectWriterException: Could not convert object 'CloseButton_Click' (of type System.String) to {clr-namespace:System;assembly=mscorlib}EventHandler({clr-namespace:Avalonia.Interactivity;assembly=Avalonia.Interactivity}RoutedEventArgs): Referenced value method CloseButton_Click in type Avalonia.Controls.Window indicated by event System.EventHandler`1[[Avalonia.Interactivity.RoutedEventArgs, Avalonia.Interactivity, Version=0.7.0.0, Culture=neutral, PublicKeyToken=null]] was not found ---> Portable.Xaml.XamlObjectWriterException: Referenced value method CloseButton_Click in type Avalonia.Controls.Window indicated by event System.EventHandler`1[[Avalonia.Interactivity.RoutedEventArgs, Avalonia.Interactivity, Version=0.7.0.0, Culture=neutral, PublicKeyToken=null]] was not found
   at Portable.Xaml.ComponentModel.EventConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\PortableXaml\portable.xaml.github\src\Portable.Xaml\Portable.Xaml.ComponentModel\EventConverter.cs:line 72
   at Portable.Xaml.XamlObjectWriterInternal.GetCorrectlyTypedValue(XamlMember xm, XamlType xt, Object value) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\PortableXaml\portable.xaml.github\src\Portable.Xaml\Portable.Xaml\XamlObjectWriter.cs:line 687
   --- End of inner exception stack trace ---
   at Portable.Xaml.XamlObjectWriterInternal.GetCorrectlyTypedValue(XamlMember xm, XamlType xt, Object value) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\PortableXaml\portable.xaml.github\src\Portable.Xaml\Portable.Xaml\XamlObjectWriter.cs:line 694
   at Portable.Xaml.XamlObjectWriterInternal.StoreAppropriatelyTypedValue(ObjectState state, MemberAndValue ms, Object obj, Object keyObj) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\PortableXaml\portable.xaml.github\src\Portable.Xaml\Portable.Xaml\XamlObjectWriter.cs:line 620
   at Portable.Xaml.XamlObjectWriterInternal.OnWriteValue(Object value) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\PortableXaml\portable.xaml.github\src\Portable.Xaml\Portable.Xaml\XamlObjectWriter.cs:line 573
   at Portable.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\PortableXaml\portable.xaml.github\src\Portable.Xaml\Portable.Xaml\XamlServices.cs:line 128
   at Avalonia.Markup.Xaml.AvaloniaXamlLoader.LoadFromReader(XamlReader reader, AvaloniaXamlContext context, IAmbientProvider parentAmbientProvider) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\AvaloniaXamlLoader.cs:line 214
   at Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(Stream stream, Assembly localAssembly, Object rootInstance, Uri uri) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\AvaloniaXamlLoader.cs:line 190
   at Avalonia.DesignerSupport.DesignWindowLoader.LoadDesignerWindow(String xaml, String assemblyPath) in D:\a\1\s\src\Avalonia.DesignerSupport\DesignWindowLoader.cs:line 30
   at Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.<>c__DisplayClass18_0.<OnTransportMessage>b__0() in D:\a\1\s\src\Avalonia.DesignerSupport\Remote\RemoteDesignerEntryPoint.cs:line 199
The method is defined in MainWindow.xaml.cs
Jeremy Koritzinsky
@jkoritzinsky
Dec 24 2018 18:37
@kekekeks does the designer support event handlers and the x:Class directive?