edwinbernadus / starter-template-avalonia

starter template avaloniaUI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

starter-template-avalonia

Getting Started

** read this first **
https://github.com/edwinbernadus/starter-template-frontend-framework

plain / non-MVVM version avaiable in
https://github.com/edwinbernadus/starter-template-avalonia/tree/non-mvvm-version

Snippet List

  • hint_create_button
<!-- // hint_create_button -->
<Button Width="160" Command="{Binding OnClickCommand}">Go To Detail Button </Button>
  • hint_open_new_page
// hint_open_new_page
var vm = MainWindowViewModel.CurrentContext;
vm.NavigateNext();
  • hint_loading_webservice
// hint_loading_webservice
var url = "https://jsonplaceholder.typicode.com/albums";
var content = await httpClient.GetStringAsync(url);
var items = JsonConvert.DeserializeObject<List<PlaceHolderItem>>(content);
  • hint_show_loading_indicator
// hint_show_loading_indicator
this.IsVisibleLoading = true;
this.IsVisibleContent = false;
  • hint_show_webservice_result_on_list
<!-- // hint_show_webservice_result_on_list -->
<ItemsControl Items="{Binding Items}" IsVisible="{Binding IsVisibleContent,Mode=TwoWay}">
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <StackPanel>
                <TextBlock Text="{Binding title}" />
                <Button Width="160" Command="{Binding OnInfoClickCommand}">Info</Button>
            </StackPanel>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>
  • hint_button_on_list
<!-- //hint_button_on_list -->
<Button Width="160" Command="{Binding OnInfoClickCommand}">Info</Button>
  • hint_show_detail_item_on_alert
// hint_show_detail_item_on_alert
this.Parent.DisplayInfoAlert = $"{id}-{title}";

About

starter template avaloniaUI

License:MIT License


Languages

Language:C# 100.0%