These are chat archives for AvaloniaUI/Avalonia

13th
Aug 2017
Alexande Daubricourt
@Akronae
Aug 13 2017 07:59
Hi, great framework guys, do you know how to set, for instance a textbox's text color ?
Nikita Tsukanov
@kekekeks
Aug 13 2017 08:41

$(NuGetPackageRoot) and $(SkiaSharpVersion) are both unset in Avalonia.Skia.RenderTests.csproj

The first one is set during nuget restore

Second one is defined in our SkiaSharp.props file, you need to import it
Matthijs ter Woord
@mterwoord
Aug 13 2017 08:51
Awesome. made "unittests" in my app which tests views etc.. :)
if they can be loaded
awesome. Operation is not valid due to the current state of the object
helpful error. .. :(
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:14
how to put colors in resources?
Alexande Daubricourt
@Akronae
Aug 13 2017 09:23
No, i have a textbox (<TextBox Name="Tb" TextAlignment="Center" Background="#22313F" Width="150" BorderThickness="0" BorderBrush="gray"></TextBox>) that i want his font's color to be white
Alexande Daubricourt
@Akronae
Aug 13 2017 09:46
Just found the anwser:
  <Window.Styles>
    <Style Selector="TextBox.Email">
      <Setter Property="Foreground" Value="white"></Setter>
    </Style>
  </Window.Styles>
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:47
you could also put the foreground property on the element itself
Alexande Daubricourt
@Akronae
Aug 13 2017 09:48
Oh yeah, you'r right
But there is one last thing that i don't understand, its how to bind xaml -> cs
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:49
via datacontext
you know mvvm patttern?
Alexande Daubricourt
@Akronae
Aug 13 2017 09:49
Yeah i did that
and i can bind text
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:49
then use {Binding YourProperty}
ah ok
Alexande Daubricourt
@Akronae
Aug 13 2017 09:49
But if i want to grap a textbox for instance
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:49
grap?
you mean access the textbox from the viewmodel?
Alexande Daubricourt
@Akronae
Aug 13 2017 09:49
is there a thing like GetElement("MyTextBox") ?
Yeah grab* :')
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:50
where would you place that code?
Alexande Daubricourt
@Akronae
Aug 13 2017 09:50
In InitializeComponent ?
Or in public MainWindowViewModel () ?
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:50
ah, in the view itself there's a method. hol don
there are Find* methods
see intellisense
Alexande Daubricourt
@Akronae
Aug 13 2017 09:51
Ok so, if i want to know when the user click on a button
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:51
you'd normally uyse commands for that
on the viewmodel
Alexande Daubricourt
@Akronae
Aug 13 2017 09:52
Oh yeah right i saw that somewhere !
Well i'm starting to understand avalonia ! ^^
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:52
command is basically an abstraction over Enabled and Click
command pattern is something that's used in all mvvm-like environments
(wpf, uwp, etc)
Alexande Daubricourt
@Akronae
Aug 13 2017 09:53
Ok thanks !
I think i'm in the right way ! :)
this.Find<TextBox>("Tb") Works like magic! Thanks
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:58
to me, each time you use those methods, you're kind-of cheating the mvvm approach though
(ie, general rule of thumb)
Alexande Daubricourt
@Akronae
Aug 13 2017 09:59
Yeah sure as long as i can use XAML, i will not use this API
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:59
what are you trying to achieve here?
Alexande Daubricourt
@Akronae
Aug 13 2017 09:59
But i'm certain that there are few cases where this API is usefull
Matthijs ter Woord
@mterwoord
Aug 13 2017 09:59
i'm not denying the fact the api is awesome for some situations
what are you trying to achieve?
Alexande Daubricourt
@Akronae
Aug 13 2017 09:59
Wall i just created a .Net standard project
Wich is a kind og
of bot*
And i just need a control panel
Matthijs ter Woord
@mterwoord
Aug 13 2017 10:00
i mean with the Find<> call, what are you tryig to do there
Alexande Daubricourt
@Akronae
Aug 13 2017 10:00
But i'm glad Avalonia exists, cause if not, i would go for electron
Well nothing, i'm just experimenting Avalonia
And, it surpassed my expectations
I'm just a bit scared that cross-plat fail
Matthijs ter Woord
@mterwoord
Aug 13 2017 10:04
fail?
i had stuff run on windows (x64) and raspberry already :)
depends on how "Correct" you develop, imo
Matthijs ter Woord
@mterwoord
Aug 13 2017 11:28
i'm having difficulties building the sources...
:(
Bahram Pouryousefi
@BpsTheCool
Aug 13 2017 12:07
@mterwoord could you please explain how did you make your app run on raspberry?
Matthijs ter Woord
@mterwoord
Aug 13 2017 12:07
use multitargetting for the projects, and use .net core 2.0 (preview 1 when i tried)
Matthijs ter Woord
@mterwoord
Aug 13 2017 12:17
anyone aroud to help me build latest avalonia?
getting errors, saying it cant find Newtonsoft.Json version 6.0.0.0
Bahram Pouryousefi
@BpsTheCool
Aug 13 2017 12:25
thanks. by the way I can't download vs extension from https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio but I can download it from https://marketplace.visualstudio.com/items?itemName=SJKirk.AvaloniaforVisualStudio what's wrong with it? download button only refreshes the page for me!
Matthijs ter Woord
@mterwoord
Aug 13 2017 12:29
no clue on that one...
Alexande Daubricourt
@Akronae
Aug 13 2017 13:31
Well, i have avalonia and Json.Net without trouble
Try to create a new solution with 1 avalonia project and one .net standard json.net project
btw is there a way to deal with responsive design ?
Eli Arbel
@aelij
Aug 13 2017 15:15
Hey. If I'm binding a TabControl to a list of items, how do I one DataTemplate for the header and another for the content of the same item?
Eli Arbel
@aelij
Aug 13 2017 15:23
I managed to do it by tweaking the tab control's template. For some reason, MemberSelector and ItemTemplate did not have a template binding in the default theme template.