示例#1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var appData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
            var folder  = Path.Combine(appData, "Ikar", "RemX", "Abstract");

            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }
            DrawingSurface.HomeFolder = folder;
            //------------------------------------------------------------------
            DrawingSurface.ContentChanged += (o, args) =>
            {
                SaveContentButton.IsEnabled = true;
            };
            DrawingSurface.SelectUpdated += (o, args) =>
            {
                GroupingButton.IsEnabled     = args.MoreOneSelected;
                UngroupingButton.IsEnabled   = args.HasGroups;
                BringToFrontButton.IsEnabled = args.HasSelected;
                SendToBackButton.IsEnabled   = args.HasSelected;
                BringToUpButton.IsEnabled    = args.HasSelected && !args.MoreOneSelected;
                SendToDownButton.IsEnabled   = args.HasSelected && !args.MoreOneSelected;
                LockButton.IsEnabled         = args.HasSelected;
                NodeeditButton.IsEnabled     = args.HasSelected;
                RotatorButton.IsEnabled      = args.HasSelected;
                AlignleftButton.IsEnabled    = args.MoreOneSelected;
                AligncenterButton.IsEnabled  = args.MoreOneSelected;
                AlignrightButton.IsEnabled   = args.MoreOneSelected;
                AligntopButton.IsEnabled     = args.MoreOneSelected;
                AlignmiddleButton.IsEnabled  = args.MoreOneSelected;
                AlignbottomButton.IsEnabled  = args.MoreOneSelected;
                SamewidthButton.IsEnabled    = args.MoreOneSelected;
                SameheightButton.IsEnabled   = args.MoreOneSelected;
                SamebothButton.IsEnabled     = args.MoreOneSelected;
                EvenlyhorButton.IsEnabled    = args.MoreTwoSelected;
                EvenlyverButton.IsEnabled    = args.MoreTwoSelected;
                UpdatePropsEditorWindow(args.Item, args.List, false);
            };
            DrawingSurface.OnZoomIn += (o, args) =>
            {
                ZoomSelector.SelectedIndex--;
            };
            DrawingSurface.OnZoomOut += (o, args) =>
            {
                ZoomSelector.SelectedIndex++;
            };

            var arr = (ZoomMode[])Enum.GetValues(typeof(ZoomMode));

            ZoomSelector.Items.Clear();
            foreach (var item in arr)
            {
                ZoomSelector.Items.Add(Fined.Value(item));
            }
            ZoomSelector.Text              = Fined.Value(ZoomMode.Scale100);
            ZoomSelector.SelectionChanged += ZoomSelector_SelectionChanged;
            ConnectPageContextMenu();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            DrawingSurface.OnZoomIn += (o, args) =>
            {
                ZoomSelector.SelectedIndex--;
            };
            DrawingSurface.OnZoomOut += (o, args) =>
            {
                ZoomSelector.SelectedIndex++;
            };

            var arr = (ZoomMode[])Enum.GetValues(typeof(ZoomMode));

            ZoomSelector.Items.Clear();
            foreach (var item in arr)
            {
                ZoomSelector.Items.Add(Fined.Value(item));
            }
            ZoomSelector.Text              = Fined.Value(ZoomMode.ZoomToFit);
            ZoomSelector.SelectionChanged += ZoomSelector_SelectionChanged;
            //-------------------------------------------
            _timer.Elapsed += _timer_Elapsed;
            _timer.Enabled  = true;
        }