Inheritance: Displayable
Beispiel #1
0
        public void NewLink(string displayname, string source, bool gotoLink = true)
        {
            //does it exist already
            var prel = from link in this.MenuLinkGroups[0].Links where link.DisplayName == displayname select link;
            if (prel.Count() != 0)
            {
                GoToLink(this.MenuLinkGroups[0].Links.IndexOf(prel.First()));
                return;
            }

            Link l = new Link();
            l.Source = new System.Uri(source, UriKind.RelativeOrAbsolute);
            l.DisplayName = displayname;

            this.MenuLinkGroups[0].Links.Add(l);

            links = this.MenuLinkGroups[0].Links;
            if (gotoLink)
                GoToLink(links.Count-1);
        }
        public OperationRootView()
        {
            InitializeComponent();

            generalBusyProgress.Visibility = Core.Instance.IsBusy ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden;
            generalBusyProgress.IsIndeterminate = (generalBusyProgress.Visibility == System.Windows.Visibility.Visible);
            
            Core.Instance.CoreBusyStateChangedEvent += CoreBusyStateChangedEvent;
            CoreBusyStateChangedEvent(this, Core.Instance.IsBusy);

            operationTab.SelectedSource = Core.Instance.Units.First<Unit>().Uri;
            
            MainThread.EnqueueTask(delegate()
            {
                foreach (var unit in Core.Instance.Units)
                {
                    Link link = new Link();
                    link.DisplayName = unit.ShortName;
                    link.Source = unit.Uri;
                    operationTab.Links.Add(link);
                }
            });
        }
Beispiel #3
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.n = ((FirstFloor.ModernUI.Presentation.Link)(target));
     return;
     }
     this._contentLoaded = true;
 }
Beispiel #4
0
        private void OnSelectedLinkChanged(Link oldValue, Link newValue) {
            if (oldValue != null) {
                oldValue.PropertyChanged -= Link_PropertyChanged;
            }

            if (newValue != null) {
                newValue.PropertyChanged += Link_PropertyChanged;
            }

            SelectedSource = newValue?.NonSelectable == false ? newValue.Source : null;

            if (newValue == null || SaveKey == null || newValue.NonSelectable) return;
            var group = (from g in LinkGroups
                         where g.Links.Contains(newValue)
                         select g).FirstOrDefault();
            if (group != null) {
                group.SelectedLink = newValue;
                ValuesStorage.Set($"{SaveKey}__{group.GroupKey}", newValue.Source);
            }
            ValuesStorage.Set($"{SaveKey}_link", newValue.Source);
        }
 public void SetThemeAndColor(string themeSourceDisplayName, Uri themeSourceUri, Color accentColor)
 {
     SelectedTheme = new Link { DisplayName = themeSourceDisplayName, Source = themeSourceUri };
     SelectedAccentColor = accentColor;
 }
        /// <summary>
        /// Adds the new links to the window.
        /// </summary>
        private void AddNewLinksToWindow()
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;
            mw.MenuLinkGroups.Clear();
            LinkGroup lg = new LinkGroup();
            Link l1 = new Link();
            l1.DisplayName = "All Test Cases";
            Uri u1 = new Uri("/Views/TestCasesInitialView.xaml", UriKind.Relative);
            l1.Source = u1;
            mw.ContentSource = u1;
            lg.Links.Add(l1);

            Link l3 = new Link();
            l3.DisplayName = "All Shared Steps";
            Uri u3 = new Uri("/Views/SharedStepsInitialView.xaml", UriKind.Relative);
            l3.Source = u3;
            lg.Links.Add(l3);

            Uri u2 = new Uri("/Views/TestCaseBatchDuplicateView.xaml#loadTestCases=true&loadSpecificTestCases=false", UriKind.Relative);
            Link l2 = new Link();
            l2.DisplayName = "Replace|Duplicate Test Cases";
            l2.Source = u2;
            lg.Links.Add(l2);

            Uri u4 = new Uri("/Views/TestCaseBatchDuplicateView.xaml#loadTestCases=false&loadSpecificTestCases=false", UriKind.Relative);
            Link l4 = new Link();
            l4.DisplayName = "Replace|Duplicate Shared Steps";
            l4.Source = u4;
            lg.Links.Add(l4);

            Uri u5 = new Uri("/Views/TestCasesMigrationView.xaml", UriKind.Relative);
            Link l5 = new Link();
            l5.DisplayName = "Migrate Test Cases";
            l5.Source = u5;
            lg.Links.Add(l5);

            mw.MenuLinkGroups.Add(lg);
        }
        private void MenuInit()
        {
            var menuCollection = this.linkGroupCollection.First((x) => { return x.GroupName == "MetaDataGroup"; });

            if (menuCollection != null)
            {
                var menuData = EnumHelper.GetLocalizedValuesList(typeof(BusinessProcessSourceType));

                for (int i = 0; i < menuData.Count; i++)
                {
                    if (menuData[i].Key.ToString() == "None")
                    {
                        continue;
                    }
                    var link = new Link();                      
                    link.DisplayName = menuData[i].Value;
                    link.Source = new Uri(string.Format("/Content/MainContent.xaml#{0}", menuData[i].Key), UriKind.Relative);
                    App.Current.Dispatcher.Invoke(new Action(()=>{
                        menuCollection.Links.Add(link);
                    }), System.Windows.Threading.DispatcherPriority.Normal);
                }
            }
        }
 private void DisplayAdminWindow()
 {
     ModernWindow mw = Window.GetWindow(this) as ModernWindow;
     Uri u1 = new Uri("/AdminApproveMembersView.xaml", UriKind.Relative);
     mw.ContentSource = u1;
     mw.MenuLinkGroups.Clear();
     LinkGroup lg = new LinkGroup();
     Link l1 = new Link();
     l1.DisplayName = "Manage Members";
     l1.Source = u1;
     lg.Links.Add(l1);
     Uri u2 = new Uri("/AdminProjectSettingsView.xaml", UriKind.Relative);
     Link l2 = new Link();
     l2.DisplayName = "Manage Project Settings";
     l2.Source = u2;
     lg.Links.Add(l2);
     mw.MenuLinkGroups.Add(lg);
     Uri logoutUri = new Uri("/LoginView.xaml", UriKind.Relative);
     Link logoutLink = new Link();
     logoutLink.DisplayName = "Log out";
     logoutLink.Source = logoutUri;
     mw.TitleLinks.Add(logoutLink);
 }
Beispiel #9
0
        public void BuidMenu()
        {
            var list = ReflectiveEnumerator.GetEnumerableOfType<AxonScreen>();
            Screens = new ObservableCollection<AxonScreen>(list);
                      LinkGroupCollection col = new LinkGroupCollection();
            foreach (LinkGroup linkGroup in MenuLinkGroups)
            {
                var screens = (from s in list where s.ModuleName == linkGroup.DisplayName select s) ;
                foreach (AxonScreen screen in screens)
                {
                    var mi = new Link
                    {
                        DisplayName = screen.ScreenName,
                        Source = screen.SourcePath
                    };
                    linkGroup.Links.Add(mi);
                }
            }
               //foreach (var s in list.ToArray())
               // {
               //     var mod = MenuLinkGroups.FirstOrDefault(n => (string)n.DisplayName == s.ModuleName);
               //     if (mod == null )
               //     {
               //         foreach (var screen in list.ToArray())
               //         {
               //             if (screen.ModuleName != s.ModuleName) continue;
               //             screen.DataService = Mds;
               //             screen.Shell = this;
               //             var mi = new Link
               //             {
               //                 DisplayName = screen.ScreenName,
               //                 Source=screen.SourcePath
               //             };
               //             mod.Links.Add(mi);
               //         }
               //     }
               // }

            this.UpdateLayout();
        }
        /// <summary>
        /// Adds the new links to window.
        /// </summary>
        private void AddNewLinksToWindow()
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;
            mw.MenuLinkGroups.Clear();
            LinkGroup lg = new LinkGroup();

            Link l1 = new Link();
            l1.DisplayName = "Edit Playlists";
            Uri u1 = new Uri("/Views/YouTubePlaylistsEditView.xaml", UriKind.Relative);
            l1.Source = u1;
            mw.ContentSource = u1;
            lg.Links.Add(l1);

            Link l3 = new Link();
            l3.DisplayName = "YouTube Player";
            Uri u3 = new Uri("/Views/YouTubePlayerView.xaml", UriKind.Relative);
            l3.Source = u3;
            lg.Links.Add(l3);     
            mw.MenuLinkGroups.Add(lg);
        }