Example #1
0
        private void Open()
        {
            var ofd = new SWF.OpenFileDialog {
                Filter = "XAML|*.xaml", Multiselect = true
            };

            if (ofd.ShowDialog() == SWF.DialogResult.OK)
            {
                var length = ofd.FileNames.Length;
                for (int i = 0; i < length; i++)
                {
                    var fileName = ofd.FileNames[i];
                    var tab      = XamlTabs.FirstOrDefault(t => t.FileName == fileName);
                    if (tab != null)
                    {
                        if (i == length - 1)
                        {
                            tab.IsSelected = true;
                            MoveToVisible(tab);
                        }
                    }
                    else
                    {
                        tab = new TabViewModel(fileName, CloseXamlTab);
                        XamlTabs.Insert(0, tab);

                        if (i == length - 1)
                        {
                            tab.IsSelected = true;
                        }
                    }
                }
            }
        }
Example #2
0
        private void Open(string[] files)
        {
            var length = files.Length;

            for (int i = 0; i < length; i++)
            {
                var fileName = files[i];
                var tab      = XamlTabs.FirstOrDefault(t => t.FileName == fileName);
                if (tab != null)
                {
                    if (i == length - 1)
                    {
                        tab.IsSelected = true;
                        MoveToVisible(tab);
                    }
                }
                else
                {
                    tab = new TabViewModel(fileName, CloseXamlTab);
                    XamlTabs.Insert(0, tab);

                    if (i == length - 1)
                    {
                        tab.IsSelected = true;
                    }
                }
            }
        }
Example #3
0
        private void Help()
        {
            var helpTab = XamlTabs.FirstOrDefault(tab => (tab.Status & TabStatus.Inner) == TabStatus.Inner && tab.FileName == InternalConstStrings.HelpFileName);

            if (helpTab == null)
            {
                helpTab = new TabViewModel(InternalConstStrings.HelpFileName, TabStatus.Inner, CloseXamlTab, false);
                XamlTabs.Insert(0, helpTab);

                helpTab.IsSelected = true;
            }
            else
            {
                helpTab.IsSelected = true;
                MoveToVisible(helpTab);
            }
        }
Example #4
0
        private void Help()
        {
            var helpTab = XamlTabs.FirstOrDefault(tab => (tab.Status & TabStatus.Inner) == TabStatus.Inner);

            if (helpTab == null)
            {
                helpTab = new TabViewModel("Help.xaml", TabStatus.Inner, CloseXamlTab);
                XamlTabs.Insert(0, helpTab);

                helpTab.IsSelected = true;
            }
            else
            {
                helpTab.IsSelected = true;
                MoveToVisible(helpTab);
            }
        }
Example #5
0
        private void OnInitWorkArea()
        {
            _isWorkAreaIniting = true;

            NewCommand.RaiseCanExecuteChanged();
            OpenCommand.RaiseCanExecuteChanged();
            SaveAllCommand.RaiseCanExecuteChanged();

            //Work Area
            var selectedTab = XamlTabs.FirstOrDefault(tab => tab.IsSelected);

            selectedTab?.InitWorkArea();

            _isWorkAreaIniting = false;

            NewCommand.RaiseCanExecuteChanged();
            OpenCommand.RaiseCanExecuteChanged();
            SaveAllCommand.RaiseCanExecuteChanged();
        }
Example #6
0
        private void Open()
        {
            var ofd = new SWF.OpenFileDialog {
                Filter = "XAML|*.xaml"
            };

            if (ofd.ShowDialog() == SWF.DialogResult.OK)
            {
                var tab = XamlTabs.FirstOrDefault(t => t.FileName == ofd.FileName);
                if (tab != null)
                {
                    tab.IsSelected = true;
                    MoveToVisible(tab);
                }
                else
                {
                    var newTab = new TabViewModel(ofd.FileName, CloseXamlTab);
                    XamlTabs.Insert(0, newTab);
                    newTab.IsSelected = true;
                }
            }
        }
Example #7
0
        private void Example(int?type)
        {
            if (type == null || !ResourcesMap.ExampleFileNameDic.ContainsKey(type.Value))
            {
                return;
            }

            var fileName = ResourcesMap.ExampleFileNameDic[type.Value];

            var exampleTab = XamlTabs.FirstOrDefault(tab => (tab.Status & TabStatus.Inner) == TabStatus.Inner && tab.FileName == fileName);

            if (exampleTab == null)
            {
                exampleTab = new TabViewModel(fileName, TabStatus.Inner, CloseXamlTab);
                XamlTabs.Insert(0, exampleTab);

                exampleTab.IsSelected = true;
            }
            else
            {
                exampleTab.IsSelected = true;
                MoveToVisible(exampleTab);
            }
        }