These are chat archives for AvaloniaUI/Avalonia

8th
Jan 2017
Steven Kirk
@grokys
Jan 08 2017 00:45
i've committed a fix for #829 in #843 but I'd like some input on whether this is acceptable
Darnell Williams
@Seeker1437
Jan 08 2017 00:46
sooo
I have admin rights and I am being restricted from managing my system settings....
wtf??
Steven Kirk
@grokys
Jan 08 2017 00:47
in particular @wieslawsoltes @danwalmsley will this cause you problems? i suspect you might be using UserControls with names for bindings (seeing as we lack an equivalent of RelativeSource.FindAncestor)
@Seeker1437 I didn't do it!
not that one!
Darnell Williams
@Seeker1437
Jan 08 2017 00:56
Lol haha, I know it's just weird
all the sudden I am plock from using the mmc entirely... no device manager... no nothing
and google is not helping me
anyways, hey I was curious, is it okay to ship things using nightly builds?
Darnell Williams
@Seeker1437
Jan 08 2017 01:01
I really wanted to stay with nuget.org releases, but right now beta 4 eems to have an issues with the HtmlRenderer stuff
Steven Kirk
@grokys
Jan 08 2017 01:10
sure, as long as you accept responsibility for any problems ;)
it's not like the stable builds are that stable - it's all still alpha
Darnell Williams
@Seeker1437
Jan 08 2017 01:11
Fair point ;D
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 12:18
@grokys AvaloniaUI/Avalonia#844 Just tested and it fixed the issue!
Steven Kirk
@grokys
Jan 08 2017 12:31
great! do you think #843 will cause you problems?
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 12:32
Not sure have to test with Core2D
Nikita Tsukanov
@kekekeks
Jan 08 2017 12:53
Guys... It seems that here is our "WinXP support": https://github.com/Skulltrail192/One-Core-Api
This guy somehow adapted code from Wine/ReactOS to run on WinXP and provide APIs from Vista+
Steven Kirk
@grokys
Jan 08 2017 12:55
whaaaaaa!!? that's amazing if it works
Steven Kirk
@grokys
Jan 08 2017 12:55
wow
It comes with DirectX 10 support
Steven Kirk
@grokys
Jan 08 2017 12:56
one man did what MS couldn't
Nikita Tsukanov
@kekekeks
Jan 08 2017 12:56
not couldn't
wouldn't
Steven Kirk
@grokys
Jan 08 2017 12:56
true
Nikita Tsukanov
@kekekeks
Jan 08 2017 12:57
I'm pretty sure that there won't be .NET 4.5 there, but it should be possible to run .NET Core-based apps
Oh, nevermind, the code is GPL-licensed
Steven Kirk
@grokys
Jan 08 2017 13:06
that shouldn't have much of an effect for a project like this though right? it'd be a separate thing that you install
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 13:38
@grokys Regarding AvaloniaUI/Avalonia#843, I have tested and it seems 99% of stuff works
Only have found one issue, but its not critical
Steven Kirk
@grokys
Jan 08 2017 13:39
ok, what is the issue?
I get exception Control with the name 'container' already registered.
Steven Kirk
@grokys
Jan 08 2017 13:40
right, yeah that's what i was worried about
we need more RelativeSource options in order to not need to name UserControls
Steven Kirk
@grokys
Jan 08 2017 13:42
bceause there's only one of them added?
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 13:42
yes
the other one is inside DataTemplate
Steven Kirk
@grokys
Jan 08 2017 13:44
so it might be worth not merging this PR until at least we have RelativeSource=Self
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 13:45
You could merge, this control is not so important
Steven Kirk
@grokys
Jan 08 2017 13:45
or as a hack for the moment we could not try not registering if there's already a named control with that name
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 13:46
this will probably break other stuff in Core2D
Steven Kirk
@grokys
Jan 08 2017 13:46
what do you mean?
this works currently
Steven Kirk
@grokys
Jan 08 2017 13:47
i think that would still work - controls would still get registered as before
probably the best fix is to implement RelativeSource=Self for now
that would be simple i think
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 13:48
yeah
Steven Kirk
@grokys
Jan 08 2017 13:48
and would be generally very useful!
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 13:49
for sure RelativeSource=Self would be very helpful
Steven Kirk
@grokys
Jan 08 2017 13:49
i will do that then
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 13:49
do you will add some special syntax
Steven Kirk
@grokys
Jan 08 2017 13:50
i'd like to eventually yeah: like $self.Width or something
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 13:50
AvaloniaUI/Avalonia#590
Steven Kirk
@grokys
Jan 08 2017 13:50
but for the moment it'll just be WPF syntax
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 13:50
ok
Steven Kirk
@grokys
Jan 08 2017 13:51
because i want to get a release out very soon
Darnell Williams
@Seeker1437
Jan 08 2017 13:51
@grokys now my computer bluescreens on boot xD
Steven Kirk
@grokys
Jan 08 2017 13:51
sounds like it's messed up!
Darnell Williams
@Seeker1437
Jan 08 2017 13:51
Not your fault, but I think this last Windows update killed it xD
Should I switch to Mac xD
It would happen at the most critical time of my life.
Well that's a bit of an exaggeration lol
Steven Kirk
@grokys
Jan 08 2017 13:58
well it only takes 30 mins to reinstall windows these days ;)
visual studio on the other hand takes about 6 hours
Darnell Williams
@Seeker1437
Jan 08 2017 13:59
For me it take about an hour and a half normally.
Though the last time I tried to install, but vs2017 failed and won't fix itself xD
I got as far as upgrading to nightly at least
So once I'm back up and running I'll test it out
Steven Kirk
@grokys
Jan 08 2017 14:17
@wieslawsoltes RelativeSource=Self implemented in #848
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 14:20
ok will try after CI build is done
Darnell Williams
@Seeker1437
Jan 08 2017 14:25
@grokys Im back on fresh windows xD
Steven Kirk
@grokys
Jan 08 2017 14:25
that was quick!
Darnell Williams
@Seeker1437
Jan 08 2017 14:27
Very also I have never seen this before!
The Applying bar and more progressed than the aquiring bar :O
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:04
@grokys What is xaml syntax for RelativeSource=Self
this is causing exception Width="{Binding Path=Container.Width, RelativeSource=Self}"
{"Error loading XAML: OmniXaml.ParseException: Cannot find a property named \"RelativeSource\" in the type Avalonia.Markup.Xaml.MarkupExtensions.BindingExtension\r\n   w Glass.Core.Guard.CheckForCondition[T,TException](T item, Predicate`1 p, Func`1 createException)\r\n   w Glass.Core.Guard.ThrowIfNull[TException](Object item, Func`1 createException)\r\n   w OmniXaml.Typing.Member.LookupType()\r\n   w Avalonia.Markup.Xaml.Context.AvaloniaXamlType.LookupMember(String name)\r\n   w OmniXaml.Parsers.MarkupExtensions.MarkupExtensionNodeToXamlNodesConverter.<ParseProperties>d__6.MoveNext()\r\n   w OmniXaml.Parsers.MarkupExtensions.MarkupExtensionNodeToXamlNodesConverter.<ParseMarkupExtensionNode>d__1.MoveNext()\r\n   w OmniXaml.Parsers.Parser.InstructionParser.<ParseMembersOfObject>d__39.MoveNext()\r\n   w OmniXaml.Parsers.Parser.InstructionParser.<ParseNonEmptyElement>d__27.MoveNext()\r\n   w OmniXaml.Parsers.Parser.InstructionParser.<ParseElements>d__24.MoveNext()\r\n   w OmniXaml.Parsers.Parser.InstructionParser.<Parse>d__23.MoveNext()\r\n   w OmniXaml.MemberDependencyNodeSorter.<Sort>d__11.MoveNext()\r\n   w OmniXaml.XmlParser.Parse(IEnumerable`1 xamlNodes)\r\n   w OmniXaml.XmlParser.Parse(IXmlReader stream)\r\n   w OmniXaml.XmlLoader.Load(Stream stream, IParser parser)"}
Steven Kirk
@grokys
Jan 08 2017 15:14
it should be the same as WPF: http://stackoverflow.com/a/11995467/6448
it's ugly syntax i know
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:18
Width="{Binding Path=Container.Width, RelativeSource={RelativeSource Self}}"
like this, this also causes same exception
Steven Kirk
@grokys
Jan 08 2017 15:19
maybe omnixaml can't handle nested binding extensions
i'd not actually tried the xaml - let me give it a go
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:19
DataContext="{Binding RelativeSource={RelativeSource Self}}"
same exception
Steven Kirk
@grokys
Jan 08 2017 15:20
hmm
yeah seems to be an omnixaml problem :(
the long-form binding syntax should work though
    <TextBlock Tag='foo'>
        <TextBlock.Text>
            <Binding RelativeSource='{RelativeSource Self}' Path='Tag'/>
        </TextBlock.Text>
    </TextBlock>
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:24
    <UserControl.DataContext>
        <Binding RelativeSource="{RelativeSource Self}"/>
    </UserControl.DataContext>
this does not work
ah sorry did not remove not working xaml
Steven Kirk
@grokys
Jan 08 2017 15:29
SuperJMN/OmniXAML#119
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:31

tried this

    <UserControl.Width>
        <Binding RelativeSource="{RelativeSource Self}" Path="Container.Width"/>
    </UserControl.Width>
    <UserControl.Height>
        <Binding RelativeSource="{RelativeSource Self}" Path="Container.Height"/>
    </UserControl.Height>

but I get error:

Core2D.Avalonia.Skia.vshost.exe Error: 0 : Binding: Error in binding to "Core2D.Avalonia.Views.ContainerViewControl"."Width": "Null value in expression 'Container.Width' at 'Container'."
Core2D.Avalonia.Skia.vshost.exe Error: 0 : Binding: Error in binding to "Core2D.Avalonia.Views.ContainerViewControl"."Height": "Null value in expression 'Container.Height' at 'Container'."
Steven Kirk
@grokys
Jan 08 2017 15:32
and ContainerViewControl.Container is definitely never null?
ah - it will probably have to be an AvaloniaProperty because it's a control
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:34
        public static readonly AvaloniaProperty<XContainer> ContainerProperty =
            AvaloniaProperty.Register<ContainerViewControl, XContainer>(nameof(Container));
Steven Kirk
@grokys
Jan 08 2017 15:34
ok, let me debug
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:39
@grokys Interesting when I removed Name from ContainerViewControl the FindControl does not work here <views:ContainerViewControl Name="containerControl" Renderer="{Binding Renderers[0]}" Container="{Binding Project.CurrentContainer}" ClipToBounds="False"/>
but when I set Name in UserControl to whatever the FindControl works
Steven Kirk
@grokys
Jan 08 2017 15:40
oh... that sounds like a bug
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:46
@grokys I used modification from AvaloniaUI/Avalonia#843 and FindControl works
Steven Kirk
@grokys
Jan 08 2017 15:46
ahhhh
yes, you need #843 - that's the bug it's fixing ;)
sorry i assumed you'd already merged that one in
ok, debugged and Container is initially null when the binding is setup
which is why you're getting that message
does the binding not work?
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:48
the binding works
but there must be other issue
Steven Kirk
@grokys
Jan 08 2017 15:49
ok so that's what's happening - when the binding is set up that property is null, so it outputs the message. then the property gets set to non-null and starts working
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:51
this does the trick, after you click New Project I have to wait on this line after its called 3 times :(
Steven Kirk
@grokys
Jan 08 2017 15:51
AttachEditor is called 3 times?
yes i see it
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:52
yes
Steven Kirk
@grokys
Jan 08 2017 15:53
ok, so that seems to be correct: it's called once initially because DataContext is null. Then DataContext is set so it's called the second time. Then it's attached to the visual tree so it's called the 3rd time.
does that not sound right to you?
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:56
yeah that is correct
only the error messsage was strange
Steven Kirk
@grokys
Jan 08 2017 15:56
ahhh ok yeah i understand
Darnell Williams
@Seeker1437
Jan 08 2017 15:57
Ah, HTMLRenderer doesn't render bitmaps
wwell it doesn't render images for some reason
it just appears as a white square
Steven Kirk
@grokys
Jan 08 2017 15:58
i think the error is correct because that is what's happening. i don't think WPF logs errors for null properties, i'm not sure which approach is better
@Seeker1437 that's unfortunate -- i don't know if that's supposed to work or not tbh
i've not had much involvement in HtmlRenderer
personally i don't even think it should be in core
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 15:59
@grokys Well in WPF I use OnLoaded and AttachEditor is only called once
Darnell Williams
@Seeker1437
Jan 08 2017 15:59
AH yeah true, I can understand that
I am thinking I might just create a CEFSharp control in Avalonia
Well I might need help with more experienced people because by default Avalonia is not supported XD
Steven Kirk
@grokys
Jan 08 2017 16:00
man embedded chromium would be super cool
@wieslawsoltes but OnLoaded wouldn't react to DataContext changes right?
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 16:05
yeah my Xaml for WPF and Avalonia here is different
in WPF my ContainerControl is inside DataTemplate and I use ContentControl
in Avalonia I observe DataContext property
Steven Kirk
@grokys
Jan 08 2017 16:09
ah ok, because ContentControl is slow?
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 16:10
dont remember what was the reason
Steven Kirk
@grokys
Jan 08 2017 16:11
do you think #843 and #848 are ok to merge?
Wiesław Šoltés
@wieslawsoltes
Jan 08 2017 16:11
yes
Steven Kirk
@grokys
Jan 08 2017 16:11
ok great!
danwalmsley
@danwalmsley
Jan 08 2017 22:11
@grokys is it ok to use StyleResources with in a style? like so...
<Style Selector="TabStrip > TabStripItem:selected">
      <Setter Property="BorderThickness" Value="1" />
      <Setter Property="Background" Value="{StyleResource RibbonSelectionBrush}" />      
    </Style>
Steven Kirk
@grokys
Jan 08 2017 22:12
yep!
should be...
danwalmsley
@danwalmsley
Jan 08 2017 22:13
ok it works, but in this case.
<Style Selector="TabStrip > TabStripItem">
      <Setter Property="Margin" Value="1 2 1 -1" />
      <Setter Property="BorderThickness" Value="0" />
      <Setter Property="BorderBrush" Value="{StyleResource DockItemBorderBrush}" />
      <Setter Property="FontSize" Value="14" />
      <Setter Property="Padding" Value="4 0 4 0" />
    </Style>
the border brush one doesnt
Steven Kirk
@grokys
Jan 08 2017 22:14
hmm
danwalmsley
@danwalmsley
Jan 08 2017 22:15
just double checing...
btw in selectors
TabControl > TabItem
does that mean TabItem inside TabControl?
Steven Kirk
@grokys
Jan 08 2017 22:15
exactly
danwalmsley
@danwalmsley
Jan 08 2017 22:15
ok nice
Steven Kirk
@grokys
Jan 08 2017 22:16
no, i meant: "exactly, that is the problem with TabControl - what does that mean?"
i'm pretty sure i'm going to get rid of TabControl. it's just broken in theory as well as in practise
as i say in the comment i linked:
the original problem with TabControl which is that a TabItem represents two separate controls: the header and the content. Meaning there is one set of properties for two things. If I say TabItem.Foreground = Blue do I mean that I want to style the tab blue or the contents of the tab blue?
danwalmsley
@danwalmsley
Jan 08 2017 22:17
ok sure
I think the style selector is actually working ;)
Steven Kirk
@grokys
Jan 08 2017 22:19
ok good :)
btw i just tried COntrolCatalog on bash on windows (with an X server) and it seems to work fine
danwalmsley
@danwalmsley
Jan 08 2017 22:19
iv been really using the css styling system a lot more now
really like it
Steven Kirk
@grokys
Jan 08 2017 22:19
great! :)
there's still a bit of a problem with style resources, but it mostly works
danwalmsley
@danwalmsley
Jan 08 2017 22:20
keep finding loads of new selectors, I didn't know existed...
Steven Kirk
@grokys
Jan 08 2017 22:20
i need to document them! i was sure i had but i can't find it now
danwalmsley
@danwalmsley
Jan 08 2017 22:20
like this one...
TabControl[TabStripPlacement=Left] /template/ TabStrip
oh can I also did
Grid > Button > TextBlock?
i.e. multiple > ?
milkinllc
@milkinllc
Jan 08 2017 22:22
is there a way make dropdown work as wpf combobox (editable)? I see i can put textbox as item. but when closed it is not editable.
Steven Kirk
@grokys
Jan 08 2017 22:22
@milkinllc not yet, no, sorry
milkinllc
@milkinllc
Jan 08 2017 22:22
ok. tnx
Steven Kirk
@grokys
Jan 08 2017 22:22
ok i have to go to bed! night all!