public MenuView(UIView outerView, nfloat navWidth, nfloat navHeight) { _menuVm = ServiceLocator.Current.GetInstance <MenuVm>(); _outerView = outerView; _navHeight = navHeight; _navWidth = navWidth; BuildInterface(); }
public MainWindowVm() { _frameworkVm = new FrameworkVm(); SelectedFramework = _frameworkVm; MenuVm = new MenuVm(); MenuVm.SetMenuData(); SelectedMenu = MenuVm; ControlsEnabled = true; _menuVm.ExecuteMenuNavigate += MenuVmNavigate; HelpMessage = "App help message!"; }
public MainWindowVm() { var documents = GetDocuments(); var hidableAnchorables = GetHidableAnchorables(); var notHidableAnchorables = GetNotHidableAnchorables(); var anchorables = notHidableAnchorables .Union(hidableAnchorables); DockManagerViewModel = new DockManagerVm(Directory.GetCurrentDirectory(), documents, anchorables); MenuViewModel = new MenuVm(documents, hidableAnchorables); }
public MenuVm Save(long userId, MenuVm toSave) { var menu = toSave.Menu; PreSave(userId, ref menu, toSave.ActionMode); toSave.Menu = menu; switch (toSave.ActionMode) { case Enumerations.ActionMode.Add: toSave.Menu = Create(userId, toSave.Menu); break; case Enumerations.ActionMode.Edit: toSave.Menu = Edit(userId, toSave.Menu); break; } return(Init(userId, toSave.Menu.Id)); }
public MenuVm Init(long userId, long?id) { var toRet = new MenuVm { Branches = BlBranch.GetLov(userId).ToDictionary(i => i.value, i => i.label), Statuses = BlCode.LoadTable(userId, "Status"), Menu = new Menu { Status = true }, ActionMode = Enumerations.ActionMode.Add }; if (id != 0) { var menu = LoadSingle(userId, Convert.ToInt64(id)); toRet.Menu = menu; toRet.ActionMode = Enumerations.ActionMode.Edit; } return(toRet); }