Skip to content

Instantly share code, notes, and snippets.

@3bdNKocY

3bdNKocY/VM Secret

Last active August 29, 2015 14:17
Show Gist options
  • Save 3bdNKocY/ffdfda59c4f9446db880 to your computer and use it in GitHub Desktop.
Save 3bdNKocY/ffdfda59c4f9446db880 to your computer and use it in GitHub Desktop.
<Window x:Class="Vivenda.Views.TransferUtilitiesWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Kies een pand" Height="300" Width="550"
DataContext="{Binding TransferUtilitiesWindowViewModel, RelativeSource={RelativeSource Self}}">
<Grid>
<GroupBox Header="Info" Margin="10,71,10,0" VerticalAlignment="Top" Height="163" Visibility="{Binding Path=DocumentType, Converter={StaticResource ConnectionToVisibilityConverter}, FallbackValue=Visible}" >
<Grid />
</GroupBox>
<ComboBox HorizontalAlignment="Left" Margin="115,10,0,0" VerticalAlignment="Top" Width="420" ItemsSource="{Binding Source={StaticResource documentTypes},Path=DisplayNames}"
SelectedItem="{Binding Path=DocumentType, Converter={StaticResource documentTypes}}" />
<Label Content="Document" HorizontalAlignment="Left" Margin="10,8,0,0" VerticalAlignment="Top" Width="100"/>
</Grid>
</Window>
namespace Vivenda.ViewModels
{
public class TransferUtilitiesWindowViewModel //: INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
public List<Premise> Premises { get; private set; }
public Premise Premise { get; set; }
private bool? _isBusiness;
public bool? IsBusiness
{
get { return _isBusiness; }
set
{
_isBusiness = value;
if(_isBusiness == true)
{
BusinessData = new BusinessData();
NotifyPropertyChanged("IsBusiness");
} else
{
BusinessData = null;
}
}
}
public BusinessData BusinessData { get; set; }
public UtilityDocumentType DocumentType { get; set; }
public TransferUtilitiesWindowViewModel()
{
Premises = VivendaContext.Current.Premises.ToList();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment