public EditMatchRobotsTemplate(Match _match, [CallerMemberName] string _senderPage = "") { InitializeComponent(); if (string.IsNullOrEmpty(_senderPage)) { throw new Exception("Was unable to retrieve the calling class for the bindingcontext of EditMatchRobotsTemplate"); } // Depending on the caller we will be assigning a different context to give different functionality BindingContext = new EditMatchRobotsViewModel(this, _match); }
public MatchSetupPage() { InitializeComponent(); for (int i = 0; i < Match.Robots.Length; i++) { Match.Robots[i] = new Robot { ImagePath = StageConstants.DEFAULT_ROBOT_IMAGEPATH }; } ForEditingRobotsTemplate.Content = new EditMatchRobotsTemplate(Match); BindingContext = new MatchSetupViewModel(this, Match); EditRobotCtx = (EditMatchRobotsViewModel)((EditMatchRobotsTemplate)ForEditingRobotsTemplate.Content).BindingContext; PreparePickerOptions(); }