Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MXML 1.37 KB | None | 0 0
  1. <Window x:Class="MvvmDemo.MainWindow"
  2.        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5.        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6.        xmlns:local="clr-namespace:MvvmDemo"
  7.        xmlns:vm="clr-namespace:MvvmDemo.ViewModel"
  8.        mc:Ignorable="d"
  9.        Title="MainWindow" Height="450" Width="800">
  10.     <Window.Resources>
  11.         <vm:CustomerViewModel x:Key="CustomerViewModel"></vm:CustomerViewModel>
  12.     </Window.Resources>
  13.     <Grid DataContext="{Binding Source ={StaticResource CustomerViewModel}}">
  14.         <ListView HorizontalAlignment="Left" Height="316" Margin="0,94,-0.4,0" VerticalAlignment="Top" Width="794" ItemsSource="{Binding Customers}">
  15.             <ListView.View>
  16.                 <GridView>
  17.                     <GridViewColumn Header="Id" DisplayMemberBinding="{Binding CustomerId}" Width="Auto"/>
  18.                     <GridViewColumn Header="CompanyName" DisplayMemberBinding="{Binding CompanyName}" Width="Auto"/>
  19.                 </GridView>
  20.             </ListView.View>
  21.         </ListView>
  22.         <Button Content="Button" Command="{Binding GetCommand}" HorizontalAlignment="Left" Margin="75,42,0,0" VerticalAlignment="Top" Width="75"/>
  23.  
  24.     </Grid>
  25. </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement