Exemple #1
0
        public void Dispose(bool isUpdating = false)
        {
            EventSubscriber.UnSubscribe();

            /*
             * If the isUpdating is true it means the application will be force closing/killed.
             * You wil have to choose what you want to do in this case.
             * By default the settings class clears the settings object and recreates it; but if killed untimely it will not save.
             *
             * Suggested use is to not save settings if updating. Other disposing events could happen based on your needs.
             */
            Settings.Default.Save();
        }
Exemple #2
0
        public TabItem CreateTab()
        {
            var content = new ShellView();

            content.Loaded += ShellViewModel.Loaded;
            var tabItem = new TabItem
            {
                Header  = Name,
                Content = content
            };

            //do your gui stuff here
            EventSubscriber.Subscribe();
            //content gives you access to the base xaml
            return(tabItem);
        }
        public TabItem CreateTab()
        {
            this.Locale = LocaleHelper.Update(Constants.CultureInfo);
            var content = new ShellView();
            // TODO: Loaded event not needed?, content.Loaded += ShellViewModel.Loaded;
            var tabItem = new TabItem {
                Header  = this.Name,
                Content = content
            };

            // do your gui stuff here
            EventSubscriber.Subscribe();

            // content gives you access to the base xaml
            return(tabItem);
        }