<ListBox Grid.Column="1" ItemsSource="{Binding Notes}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="1" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Title}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ListBox>
Связанные пакеты xamarin.form xamarin.essentialis по прежнему не хотят ставиться или или обновляться до более новых версий. В любом случае это уже большой прогрес.
public interface IDoSomethingService
{
Result GetSomething();
}
<Button IsDefault="True" Click="acceptButton_Click" Command="{Binding ConfirmCommand}">OK (IsDefault=True)</Button>
void acceptButton_Click(object sender, RoutedEventArgs e)
{
// Accept the dialog and return the dialog result
this.DialogResult = true;
}
var vm = new DialogVM();
var customDialog = new CustomDialog {
DataContext = vm
};
customDialog.ShowDialog();
if(customDialog.DialogResult.Value)
return new Result(vm.Some);
return null;
//We are dependent on properties provided by MainWindowViewModel so just make sure we
//have that. In production you'd want to abstract this property access away behind an
//interface or perhaps a dedicated viewmodel used to extract information from command
public interface IGetFilePathService
{
string GetFilePath(string folder);
}