public override void OnInitialise() { base.OnInitialise(); _content1 = CreateContentModel <Content1ViewModel>(); _content2 = CreateContentModel <Content2ViewModel>(); }
public Window() { InitializeComponent(); var vm = new XViewModel(); vm.Name = "My Name"; DataContext = vm; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SessionPrefix = Guid.NewGuid().ToString(); Model = new XViewModel(); } }
public override void OnInitialise() { base.OnInitialise(); _content1 = CreateContentModel<Content1ViewModel>(); _content2 = CreateContentModel<Content2ViewModel>(); }
public void ShowViewModel(XViewModel vm) { var vmPage = _packages.FirstOrDefault(_ => _.ViewModel == vm); if (vmPage == null) { return; } ShowNavPage(vmPage); }
protected void SetMaster(XViewModel masterPage) { MasterViewModel = masterPage; var selectable = MasterViewModel as ISelectableItem <XViewModel>; if (selectable != null) { selectable.SelectionChanged += selectable_SelectionChanged; } }
protected async void ShowNavPage(INavigationPackage package) { if (!await OnShowingPage(package.ViewModel)) { return; } CurrentDetail?.OnDeactivated(); package.Showing(); DetailContent = package.Page; CurrentDetail = package.ViewModel; CurrentDetail?.OnActivated(); }
public IActionResult Index() { ViewBag.ServiceData = _xService.GetServiceName(); var xItem = new XItem { Name = "Name X", Description = "Decription X" }; _xRepository.Add(xItem); _xRepository.SaveChange(); var model = new XViewModel { Name = xItem.Name, Description = xItem.Description }; return(View(model)); }
public Page Init(XFrame rootFrame, XViewModel rootViewModel) { RootViewModel = rootViewModel; var rootPage = _viewResolver.Resolve(rootViewModel); if (rootPage == null) { throw new InvalidOperationException("Could not resolve the inital views"); } _configureNavigation(rootFrame, rootPage); _configureAlerts(rootPage); rootFrame.Init(); return(rootPage); }
public Page Init(XFrame rootFrame, XViewModel rootViewModel) { RootViewModel = rootViewModel; var rootPage = _viewResolver.Resolve(rootViewModel); if (rootPage == null) { throw new InvalidOperationException("Could not resolve the inital views"); } _configureNavigation(rootFrame, rootPage); _configureAlerts(rootPage); rootFrame.Init(); return rootPage; }
public UIElement Init(XFrame rootFrame, XViewModel rootViewModel, bool isRoot) { RootViewModel = rootViewModel; var rootPage = _viewResolver.ResolvePageType(rootViewModel); if (rootPage == null) { throw new InvalidOperationException("Could not resolve the inital views"); } UIElement rootElement = _configureNavigation(rootFrame, rootPage, isRoot); rootFrame.Init(); if (isRoot) { _dispatcher.Invoke(() => rootFrame.NavigateTo(rootViewModel)); } return rootElement; }
public UIElement Init(XFrame rootFrame, XViewModel rootViewModel, bool isRoot) { RootViewModel = rootViewModel; var rootPage = _viewResolver.ResolvePageType(rootViewModel); if (rootPage == null) { throw new InvalidOperationException("Could not resolve the inital views"); } UIElement rootElement = _configureNavigation(rootFrame, rootPage, isRoot); rootFrame.Init(); if (isRoot) { _dispatcher.Invoke(() => rootFrame.NavigateTo(rootViewModel)); } return(rootElement); }
protected void AddPage(XViewModel sectionPage) { SectionViewModels.Add(sectionPage); }
void _onNavigateToPage(XViewModel navigateViewModel) { }
public Window2(XViewModel vm) { InitializeComponent(); DataContext = vm; }
protected async virtual Task <bool> OnShowingPage(XViewModel vm) { return(true); }