These are chat archives for AvaloniaUI/Avalonia

29th
Mar 2018
danwalmsley
@danwalmsley
Mar 29 2018 03:06
It's currently being worked on see pull requests
Nikita Tsukanov
@kekekeks
Mar 29 2018 07:59
@grokys I have an idea
We should announce that the funds from opencollective will go to whoever gets us a proper DataGrid (i. e. ported from Xceed, Silverlight or WPF toolkit)
That will help both with collecting the funds and with getting a datagrid
Steven Kirk
@grokys
Mar 29 2018 08:11
heh, yeah that's a nice idea
but we should also probably use some of those funds to set up a server for the website that we all have access to
because when you're busy/away there's no way for us to update/maintain the server
Matthijs ter Woord
@mterwoord
Mar 29 2018 08:13
what system is used for the website?
ie, cms for example?
Steven Kirk
@grokys
Mar 29 2018 08:15
Matthijs ter Woord
@mterwoord
Mar 29 2018 08:16
i'd suggest setting up a CD pipeline and putting site in github..
does appveyor let you configure private keys (for ftp-ing to target site)?
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 29 2018 08:17
btw... Why not to ask MS give you BizSpark? It will give you some azure monthly credit for three years
Matthijs ter Woord
@mterwoord
Mar 29 2018 08:18
that means having to setup a business
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 29 2018 08:18
No.. you can get it as Indie developer
Matthijs ter Woord
@mterwoord
Mar 29 2018 08:18
?
you have to be registered as company i think
Igor Gritsenko
@Igor_Gritsenko_twitter
Mar 29 2018 08:26
When I got it two years ago, it wasn't neccessary
Matthijs ter Woord
@mterwoord
Mar 29 2018 08:27
ok. maybe that changed then
William Humphreys
@WHumphreys
Mar 29 2018 10:12
@grokys Would it not be better to use a CMS like Wordpress. Its very cheap to host and has authenticated access to change stuff. Themes are 10 a penny. The security can be a bit lax if it isnt setup correctly but its pretty good when setup right.
A cheap online box cost peanuts these days https://lowendbox.com/
Matthijs ter Woord
@mterwoord
Mar 29 2018 10:21
there are good free themes as well imo..
Nikita Tsukanov
@kekekeks
Mar 29 2018 10:37
@grokys I can give you an FTP access, no problem
The problem is that wyam generates a ton of files
So it will take forever to upload all of them
I'm currently manually unzipping them on the server
Alex
@awulkan
Mar 29 2018 10:49
Is the website hosted on netlify?
If so, anyone that has access to merge stuff in the website repo should be able to update the website.
Netlify just pulls down the latest repo version.
Matthijs ter Woord
@mterwoord
Mar 29 2018 10:55
with visual studio online you can do similar things like that (including just using wyam etc) and deploy anywhere
Alex
@awulkan
Mar 29 2018 10:58
What I'm saying is that there's no need to ditch Wyam since all you need to do is to grant a few people access to merge in the git repo.
Matthijs ter Woord
@mterwoord
Mar 29 2018 10:58
only depends on where things are hosted
Alex
@awulkan
Mar 29 2018 10:59
If it's on Netlify then everything will be handled automatically after a merge.
Looks like it's hosted on Hetzner though...
Matthijs ter Woord
@mterwoord
Mar 29 2018 11:02
with a build server, you can do whatever you want to deploy..
Alex
@awulkan
Mar 29 2018 11:19

Netlify builds automatically for you as well, but ye, there's a bit more flexibility with a custom server. You have to implement more things manually though.

Anyway, I'm not arguing where it should be hosted, I'm just saying that there are simple ways to solve it without switching to a full blown CMS.

Achal Shah
@achal7
Mar 29 2018 11:38
Guys, i am facing an issue where a string property is not getting updated in the View.
public class MainWindowViewModel : ViewModelBase
{
public Model DataModel => new Model();
private ICommand _updateCommand;
public ICommand UpdateCommand { get => _updateCommand ?? (_updateCommand = new CommandHandler(vm => this.DataModel.Update(), true)); }
}
public class Model : AvaloniaObject
{
    public string Greeting => "Hello World! at " + DateTime.Now.ToLongTimeString();
    public static readonly StyledProperty<String> BackgroundProperty = AvaloniaProperty.Register<Model, String>(nameof(Background));
    public String Background
    {
        get => GetValue(BackgroundProperty);
        set => SetValue(BackgroundProperty, value);
    }
    public void Update()
    {
        Background = "Hello World! at " + DateTime.Now.ToLongTimeString();
    }
}
Matthijs ter Woord
@mterwoord
Mar 29 2018 11:39
you mean via databinding?
Achal Shah
@achal7
Mar 29 2018 11:39
Yes
Matthijs ter Woord
@mterwoord
Mar 29 2018 11:39
interesting
William Humphreys
@WHumphreys
Mar 29 2018 11:39
I just think you are all making it way to complicated as to hosing documentation. Wordpress is simple, it just works out of the box. Pretty much anybody with half a brain can use it. I think you will find many people would be happy to add to the docs as well that really dont understand all the "repo / git type" things. Another option I have used on some projects for "Docs" rather than a site as such is https://www.dokuwiki.org/dokuwiki#. Again simple to use and simple to access.
Achal Shah
@achal7
Mar 29 2018 11:39
this Background property is not getting updated in the Text box <TextBlock Text="{Binding DataModel.Background}" />
William Humphreys
@WHumphreys
Mar 29 2018 11:39
*Hosting
Matthijs ter Woord
@mterwoord
Mar 29 2018 11:40
@achal7 any warnings in the log?
Achal Shah
@achal7
Mar 29 2018 11:42
unfortunatley not
If i eveulate GetProperty and SetProperty, they do work withot any error
so seems like the Background property might be working i guess
but then why the TextBox is not getting refreshed?
Matthijs ter Woord
@mterwoord
Mar 29 2018 11:47
try explicitly setting the binding mode
i never used styledpropertes i think
Achal Shah
@achal7
Mar 29 2018 11:49
also have tried that by saying TwoWayBinding
If not styleproperties, then what is the other option to bind properties in view?
Matthijs ter Woord
@mterwoord
Mar 29 2018 11:54
i use directproperties in my vieewmodels
Steven Kirk
@grokys
Mar 29 2018 11:58
using AvaloniaObjects in view models is a bit... unusual. using it in models is plain weird ;)
having said that, it should work
Matthijs ter Woord
@mterwoord
Mar 29 2018 11:58
@grokys i know its unusual, but it gives more complex use cases, like using databinding between viewmodels etc
Steven Kirk
@grokys
Mar 29 2018 11:59
i usually just use reactiveui for that
not saying you shouldn't do it though
Matthijs ter Woord
@mterwoord
Mar 29 2018 12:00
still haven't had/taken time to read into rxui yet :(
Steven Kirk
@grokys
Mar 29 2018 12:00
@achal7 what do you have in your xaml?
Achal Shah
@achal7
Mar 29 2018 12:05
<Design.DataContext>
<vm:MainWindowViewModel/>
</Design.DataContext>
<StackPanel>
<TextBlock Text="{Binding Greeting}" />
<TextBlock Text="{Binding DataModel.Background}" />
Above is section from MainWindow.xaml
<Button Command="{Binding UpdateCommand}" >Button</Button>
Matthijs ter Woord
@mterwoord
Mar 29 2018 12:08
what is design, and does greeting work?
Achal Shah
@achal7
Mar 29 2018 12:08
Currently it displays the text when application starts
Matthijs ter Woord
@mterwoord
Mar 29 2018 12:08
i'd say drop the DataModel. prefix
Achal Shah
@achal7
Mar 29 2018 12:08
when i press the button, in debug mode i can see values are getting changed. BUT in application it still dont update the text block
but thats the property on view model.
Matthijs ter Woord
@mterwoord
Mar 29 2018 12:09
huh? the property name is Background
ah no
Achal Shah
@achal7
Mar 29 2018 12:09
So ViewModel have DataModel. DataModel have Property called Background.
found the problem.
Inside ViewModel i have replaced
public Model DataModel => new Model()
with following
Matthijs ter Woord
@mterwoord
Mar 29 2018 12:13
that's it :)
Achal Shah
@achal7
Mar 29 2018 12:13
public Model DataModel { get;set; }
any idea, why i replacing => with get;set; property works?
Matthijs ter Woord
@mterwoord
Mar 29 2018 12:19
=> is equivalent to get{ return new ..};
ie, you're recreating the value each time
you can replace => with {get;} = ..
Achal Shah
@achal7
Mar 29 2018 12:23
thank you very much :clap:
Matthijs ter Woord
@mterwoord
Mar 29 2018 12:27
i'm generally bad explainer, but makes sense?
=> means code is executed each time the value is retrieved
{get;} =.. means readonly property with one-time (per instance) initialization
Achal Shah
@achal7
Mar 29 2018 13:11
sorry for late reply, Yes it do make sense and i get the idea as well
Matthijs ter Woord
@mterwoord
Mar 29 2018 13:13
awesome!
Adam Frisby
@AdamFrisby
Mar 29 2018 13:57
Hey folks, sorry to pop in with a question straight away, but I've got a case in 0.6.1 where a window isn't repainting when the bound data is changed. Any hints/clues to force it to repaint/refresh the display?
Jumar Macato
@jmacato
Mar 29 2018 14:24
you could try InvalidateVisual() in the window/control @AdamFrisby but i dont recommend it to be used often due to performance issues that may arise :)
but also check if your Bindings are correct
Adam Frisby
@AdamFrisby
Mar 29 2018 14:33
I will check the bindings, but just for my references
how does Avalonia determine if a binding is dirty?
Jumar Macato
@jmacato
Mar 29 2018 14:44
your source property's owner class should either be implementing INotifyPropertyChanged interface, as seen here or better yet, use this project as an example for Avalonia's binding capabilities.
Avalonia will do its magic accordingly :)
Adam Frisby
@AdamFrisby
Mar 29 2018 14:49
@jmacato thankyou! :)
Jumar Macato
@jmacato
Mar 29 2018 14:51
@AdamFrisby you're welcome, also check the main site guide here for more information
regarding properties and bindings
Alexander Gnauck
@agnauck
Mar 29 2018 14:53
this example is also a good start. Its using RactiveUI:
https://github.com/AvaloniaUI/avalonia-dotnet-templates/tree/master/app-mvvm
DmitryZhelnin
@DmitryZhelnin
Mar 29 2018 14:53
btw, when I launch ControlCatalog, then Alt+Tab to another window and then back - avalonia window has artefacts until I resize it
but if there is a textbox with blinking caret the window redraws automatically
Jumar Macato
@jmacato
Mar 29 2018 14:55
I'm also having that redraw bug (window not redrawing after some period minimized) in linux. Perhaps it's a known bug, but i havent bothered checking the issues in github yet
one possible solution is to force a redraw whenever window events happens (Activation/Deactivation perhaps)