public CageControl(CageViewModel model) { InitializeComponent(); CompositionTarget.Rendering += new EventHandler(UpdateAnimalPositions); CageControlModel = model; DataContext = CageControlModel; }
public MessageControlViewModel(CageViewModel model) :base(model) { CommandKeepBirth = new RoutedCommand("CommandKeepBirth", typeof(MessageControlViewModel)); CommandSellBirth = new RoutedCommand("CommandSellBirth", typeof(MessageControlViewModel)); CommandManager.RegisterClassCommandBinding(typeof(MessageControl), new CommandBinding(CommandKeepBirth,CommandKeepBirth_Executed,CommandKeepBirth_CanExecute)); CommandManager.RegisterClassCommandBinding(typeof(MessageControl), new CommandBinding(CommandSellBirth, CommandSellBirth_Executed, CommandSellBirth_CanExecute)); }
public CageModelBase(CageViewModel model) { Model = model; }