예제 #1
0
 public Page()
 {
     //Point
     _Page = this;
     InitializeComponent();
     Loaded += new RoutedEventHandler(Page_Loaded);
 }
예제 #2
0
 public Dial180_2()
 {
     InitializeComponent();
     _timer.Duration = new Duration(new TimeSpan(0, 0, 1));
     _timer.Completed += new EventHandler(timer_Completed);
     Loaded += new RoutedEventHandler(IAmLoaded);
 }
예제 #3
0
 public ActivityWindow(string displayMessage)
 {
     InitializeComponent();
     m_displayMessage = displayMessage;
     Loaded += new RoutedEventHandler(ActivityWindow_Loaded);
     Closing += new System.ComponentModel.CancelEventHandler(ActivityWindow_Closing);
 }
예제 #4
0
 public EditIANView()
 {
     InitializeComponent();
     _vm = this.DataContext as EditIANViewModel;
     LabelControls();
     Loaded += new RoutedEventHandler(EditIANView_Loaded);
 }
예제 #5
0
		public PlanDesignerView()
		{
			InitializeComponent();

			_scrollViewer.PreviewMouseDown += OnMouseMiddleDown;
			_scrollViewer.PreviewMouseUp += OnMouseMiddleUp;
			_scrollViewer.PreviewMouseMove += OnMiddleMouseMove;
			_scrollViewer.MouseLeave += OnMiddleMouseLeave;

			_scrollViewer.PreviewMouseWheel += OnPreviewMouseWheel;
			_scrollViewer.ScrollChanged += OnScrollViewerScrollChanged;

			slider.ValueChanged += OnSliderValueChanged;
			deviceSlider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(deviceSlider_ValueChanged);

			Loaded += new RoutedEventHandler(OnLoaded);
			_scrollViewer.SizeChanged += new SizeChangedEventHandler(OnSizeChanged);
			_scrollViewer.LayoutUpdated += new EventHandler(OnLayoutUpdated);
			_timer = new DispatcherTimer()
			{
				Interval = TimeSpan.FromMilliseconds(100),
				IsEnabled = false,
			};
			_timer.Tick += (s, e) => _locked = false;
			_requreRefresh = true;
			_locked = true;
			Dispatcher.ShutdownStarted += (s, e) => RegistrySettingsHelper.SetDouble(DeviceZoomSetting, deviceSlider.Value);
			ZoomInCommand = new RelayCommand(OnZoomIn, CanZoomIn);
			ZoomOutCommand = new RelayCommand(OnZoomOut, CanZoomOut);
			DeviceZoomInCommand = new RelayCommand(OnDeviceZoomIn, CanDeviceZoomIn);
			DeviceZoomOutCommand = new RelayCommand(OnDeviceZoomOut, CanDeviceZoomOut);
		}
예제 #6
0
        internal Task<MessageDialogResult> WaitForButtonPressAsync()
        {
            AffirmativeButton.Focus();

            TaskCompletionSource<MessageDialogResult> tcs = new TaskCompletionSource<MessageDialogResult>();

            RoutedEventHandler negativeHandler = null;
            RoutedEventHandler affirmativeHandler = null;

            negativeHandler = new RoutedEventHandler((sender, e) =>
                {
                    NegativeButton.Click -= negativeHandler;
                    AffirmativeButton.Click -= affirmativeHandler;

                    tcs.TrySetResult(MessageDialogResult.Negative);
                });

            affirmativeHandler = new RoutedEventHandler((sender, e) =>
                {
                    NegativeButton.Click -= negativeHandler;
                    AffirmativeButton.Click -= affirmativeHandler;

                    tcs.TrySetResult(MessageDialogResult.Affirmative);
                });

            NegativeButton.Click += negativeHandler;
            AffirmativeButton.Click += affirmativeHandler;

            return tcs.Task;
        }
예제 #7
0
        /// <summary>
        /// Initializes a new instance of the Welcome sample page.
        /// </summary>
        public Welcome()
        {
            InitializeComponent();

            // Replace the text tokens if the sample assembly token is found
            Loaded += new RoutedEventHandler(Welcome_Loaded);
        }
예제 #8
0
        public ControlBase() : base()
        {
            /*
            //the control template must be in an embeded resource - find it
            Stream resourceStream = null;
            //if the assembly is built with VS there will be a prefix before
            //the resource name we expect. The resource name will be at the 
            //end after a dot
            string dotResource = '.' + ResourceName;
            Assembly assembly = typeof(ControlBase).Assembly;
            string[] names = assembly.GetManifestResourceNames();
            foreach (string name in names)
            {
                if (name.Equals(ResourceName) || name.EndsWith(dotResource))
                {
                    resourceStream = assembly.GetManifestResourceStream(name);
                    break;
                }
            }
            Debug.Assert(resourceStream != null, "the resource template" + ResourceName + " not found");
            StreamReader sr = new StreamReader(resourceStream);
            string xaml = sr.ReadToEnd();
            actualControl = XamlReader.Load(xaml) as UserControl;
            sr.Close();
            Debug.Assert(actualControl != null, "failed to initialize the control");

            base.Width = actualControl.Width;
            base.Height = actualControl.Height;
             */
            actualControl = this;


            Loaded += new RoutedEventHandler(OnLoaded);
        }
        public FileUploadSettingsPage()
        {
            InitializeComponent();
            this.DataContext = YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount;
            if (YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.EnableFileUpload)
            {
                this.m_CommentVisibility = System.Windows.Visibility.Collapsed;
                this.CheckBoxEnabled.IsChecked = true;
                if (string.IsNullOrEmpty(YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.LocalFileUploadDirectory) == true)
                {
                    this.LocalFileUploadDirectory = @"C:\Program Files\Yellowstone Pathology Institute\Client Services\Reports";
                }
                else
                {
                    this.LocalFileUploadDirectory = YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.LocalFileUploadDirectory;
                }
            }
            else
            {
                this.m_CommentVisibility = System.Windows.Visibility.Visible;
                this.CheckBoxEnabled.IsChecked = false;
            }

            this.DataContext = this;

            MainWindow mainWindow = (MainWindow)System.Windows.Application.Current.MainWindow;
            this.HyperlinkSignOut.Click += new RoutedEventHandler(mainWindow.ButtonSignOut_Click);
            Loaded += new RoutedEventHandler(FileUploadSettingsPage_Loaded);
        }
예제 #10
0
 /// <summary>
 /// Creates an instance of ChartLabels class.
 /// </summary>
 public ChartLabels()
 {
     _children.CollectionChanged += new NotifyCollectionChangedEventHandler(_children_CollectionChanged);
       _occupiedRects.CollectionChanged += new NotifyCollectionChangedEventHandler(_occupiedRects_CollectionChanged);
       LayoutUpdated += new EventHandler(ChartLabels_LayoutUpdated);
       Loaded += new RoutedEventHandler(ChartLabels_Loaded);
 }
예제 #11
0
		public SKDReportPresenterView()
		{
			InitializeComponent();
			Loaded += new RoutedEventHandler(SKDReportPresenterView_Loaded);
			currentPage.PreviewTextInput += new TextCompositionEventHandler(PreviewTextInputHandler);
			DataObject.AddPastingHandler(currentPage, PastingHandler);
		}
 private void SilentChangeChecked(CheckBox checkBox, bool enable, RoutedEventHandler checkedHandler, RoutedEventHandler uncheckedHandler)
 {
     checkBox.Checked   -= checkedHandler;
     checkBox.Unchecked -= uncheckedHandler;
     checkBox.IsChecked  = enable;
     checkBox.Unchecked += uncheckedHandler;
     checkBox.Checked   += checkedHandler;
 }
예제 #13
0
 public void Click(RoutedEventHandler e)
 {
     this.Button.Click += e;
 }
예제 #14
0
 public MainWindow()
 {
     InitializeComponent();
     Loaded += new RoutedEventHandler(MainWindow_Loaded);
 }
예제 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ListBoxSystemColor"/> class.
 /// </summary>
 public ListBoxSystemColor()
 {
     Loaded          += new RoutedEventHandler(SystemColorsControl_Loaded);
     this.ContextMenu = CreateMenu();
 }
예제 #16
0
        private ButtonWithObject CreateButtonWithBorderContent(Border border, object objectForButton, object context, string colorName, Thickness margin, RoutedEventHandler method)
        {
            var result = new ButtonWithObject
            {
                Content             = border,
                Margin              = margin,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Style = (Style)FindResource("MyButtonLeft"),
                HorizontalContentAlignment = HorizontalAlignment.Left,
                VerticalContentAlignment   = VerticalAlignment.Stretch,
                Object     = objectForButton,
                Context    = context,
                Background = (Brush)FindResource(colorName),
            };

            result.Click += method;

            return(result);
        }
예제 #17
0
        public GenericWindow(Window Owner, eWindowShowStyle windowStyle, string windowTitle,
                             Page windowPage, ObservableList <Button> windowBtnsList = null, bool showClosebtn = true, string closeBtnText = "Close", RoutedEventHandler closeEventHandler = null, UserControl loaderElement = null)
        {
            InitializeComponent();
            this.Owner = Owner;
            if (this.Owner != null)
            {
                this.Owner.Closing += Owner_Closing;
            }
            CurrentWindow = this;

            //set style
            CurrentWinStyle = windowStyle;
            if (CurrentWinStyle == eWindowShowStyle.Dialog)
            {
                PinBtn.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                PinBtn.Visibility = System.Windows.Visibility.Collapsed;
            }
            NeedToReShow = false;

            //set title
            winTitle.Content = windowTitle;

            //set size
            if (windowStyle == eWindowShowStyle.FreeMaximized)
            {
                this.WindowState = System.Windows.WindowState.Maximized;
            }
            else
            {
                if (windowPage != null)
                {
                    double widthDelta  = 20;
                    double heightDelta = 100;

                    //keep window min width & height
                    if (windowPage.MinWidth > 0)
                    {
                        mPageOriginalWidth = windowPage.MinWidth;
                    }
                    else if (windowPage.Width > 0)
                    {
                        mPageOriginalWidth = windowPage.Width;
                    }
                    if (windowPage.MinHeight > 0)
                    {
                        mPageOriginalHeight = windowPage.MinHeight;
                    }
                    else if (windowPage.Height > 0)
                    {
                        mPageOriginalHeight = windowPage.Height;
                    }

                    if (mPageOriginalWidth == -1)
                    {
                        windowPage.Width   = 600;
                        mPageOriginalWidth = 600;
                    }
                    if (mPageOriginalHeight == -1)
                    {
                        windowPage.Height   = this.Height;
                        mPageOriginalHeight = this.Height;
                    }

                    //doing some user screen calculations
                    double screenWidth  = System.Windows.SystemParameters.PrimaryScreenWidth;
                    double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
                    List <System.Windows.Forms.Screen> allScreens = System.Windows.Forms.Screen.AllScreens.ToList();
                    if (allScreens.Count > 1)
                    {
                        //take smallest screen size
                        foreach (System.Windows.Forms.Screen scr in allScreens)
                        {
                            if (scr.Bounds.Width < screenWidth)
                            {
                                screenWidth = scr.Bounds.Width;
                            }
                            if (scr.Bounds.Height < screenHeight)
                            {
                                screenHeight = scr.Bounds.Height;
                            }
                        }
                    }

                    //fit page size to screen size
                    if (Convert.ToString(windowPage.Tag) != "PageSizeWasModified")
                    {
                        if (windowPage.Width > 0)
                        {
                            windowPage.Width = ((windowPage.Width / 1280) * screenWidth);//relative to screen size
                        }
                        if (windowPage.Width > screenWidth)
                        {
                            windowPage.Width = screenWidth - widthDelta - 100;
                        }

                        if (windowPage.Height > 0)
                        {
                            windowPage.Height = ((windowPage.Height / 1024) * screenHeight);//relative to screen size
                        }
                        if (windowPage.Height > screenHeight)
                        {
                            windowPage.Height = screenHeight - heightDelta - 100;
                        }

                        if (windowPage.Tag == null)
                        {
                            windowPage.Tag = "PageSizeWasModified";
                        }
                    }

                    //set min height and width
                    if (windowPage.MinWidth > 0)
                    {
                        if (windowPage.Width < windowPage.MinWidth)
                        {
                            if (windowPage.MinWidth > screenWidth)
                            {
                                windowPage.MinWidth = screenWidth - widthDelta - 100;
                            }
                            windowPage.Width = windowPage.MinWidth;
                        }
                    }
                    if (windowPage.MinHeight > 0)
                    {
                        if (windowPage.Height < windowPage.MinHeight)
                        {
                            if (windowPage.MinHeight > screenHeight)
                            {
                                windowPage.MinHeight = screenHeight - heightDelta - 100;
                            }
                            windowPage.Height = windowPage.MinHeight;
                        }
                    }

                    //set the window size based on page size
                    this.Width    = windowPage.Width + widthDelta;
                    this.MinWidth = windowPage.MinWidth + widthDelta;

                    this.Height    = windowPage.Height + heightDelta;
                    this.MinHeight = windowPage.MinHeight + heightDelta;
                }
            }

            //set page content
            if (windowPage != null)
            {
                PageFrame.Content = windowPage;
            }


            //set window buttons

            //close buttons handling
            mCloseEventHandler = closeEventHandler;
            if (!showClosebtn)
            {
                CloseBtn.Visibility = System.Windows.Visibility.Collapsed;
                if (mCloseEventHandler == null)
                {
                    UpperCloseBtn.Visibility = System.Windows.Visibility.Collapsed;
                }
            }
            if (!string.IsNullOrEmpty(closeBtnText))
            {
                CloseBtn.Content      = closeBtnText;
                UpperCloseBtn.ToolTip = closeBtnText;
            }

            if (windowBtnsList != null)
            {
                foreach (Button btn in windowBtnsList)
                {
                    btn.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
                    Thickness margin = btn.Margin;
                    if (margin.Right < 10)
                    {
                        margin.Right = 10;
                    }
                    btn.Margin = margin;
                    btn.Style  = this.FindResource("$RoundTextButtonStyle_Generic") as Style;
                    DockPanel.SetDock(btn, Dock.Right);
                    BottomPanel.Children.Add(btn);
                }
            }

            if (loaderElement != null)
            {
                loaderElement.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                Thickness margin = loaderElement.Margin;
                if (margin.Left < 10)
                {
                    margin.Left = 10;
                }
                loaderElement.Margin = margin;
                //loaderElement.Style = this.FindResource("$RoundTextButtonStyle_Generic") as Style;
                DockPanel.SetDock(loaderElement, Dock.Left);
                BottomPanel.Children.Add(loaderElement);
            }
        }
예제 #18
0
        bool IContextMenuHandler.RunContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
        {
            //NOTE: Return false to use the built in Context menu - in WPF this requires you integrate into your existing message loop, read the General Usage Guide for more details
            //https://github.com/cefsharp/CefSharp/wiki/General-Usage#multithreadedmessageloop
            //return false;

            var webBrowser = (ChromiumWebBrowser)chromiumWebBrowser;

            //IMenuModel is only valid in the context of this method, so need to read the values before invoking on the UI thread
            var menuItems = GetMenuItems(model).ToList();

            webBrowser.Dispatcher.Invoke(() =>
            {
                var menu = new ContextMenu
                {
                    IsOpen = true
                };

                RoutedEventHandler handler = null;

                handler = (s, e) =>
                {
                    menu.Closed -= handler;

                    //If the callback has been disposed then it's already been executed
                    //so don't call Cancel
                    if (!callback.IsDisposed)
                    {
                        callback.Cancel();
                    }
                };

                menu.Closed += handler;

                foreach (var item in menuItems)
                {
                    if (item.Item2 == CefMenuCommand.NotFound && string.IsNullOrWhiteSpace(item.Item1))
                    {
                        menu.Items.Add(new Separator());
                        continue;
                    }

                    menu.Items.Add(new MenuItem
                    {
                        Header    = item.Item1.Replace("&", "_"),
                        IsEnabled = item.Item3,
                        Command   = new RelayCommand(() =>
                        {
                            //BUG: CEF currently not executing callbacks correctly so we manually map the commands below
                            //see https://github.com/cefsharp/CefSharp/issues/1767
                            //The following line worked in previous versions, it doesn't now, so custom EXAMPLE below
                            //callback.Continue(item.Item2, CefEventFlags.None);

                            //NOTE: Note all menu item options below have been tested, you can work out the rest
                            switch (item.Item2)
                            {
                            case CefMenuCommand.Back:
                                {
                                    browser.GoBack();
                                    break;
                                }

                            case CefMenuCommand.Forward:
                                {
                                    browser.GoForward();
                                    break;
                                }

                            case CefMenuCommand.Cut:
                                {
                                    browser.FocusedFrame.Cut();
                                    break;
                                }

                            case CefMenuCommand.Copy:
                                {
                                    browser.FocusedFrame.Copy();
                                    break;
                                }

                            case CefMenuCommand.Paste:
                                {
                                    browser.FocusedFrame.Paste();
                                    break;
                                }

                            case CefMenuCommand.Print:
                                {
                                    browser.GetHost().Print();
                                    break;
                                }

                            case CefMenuCommand.ViewSource:
                                {
                                    browser.FocusedFrame.ViewSource();
                                    break;
                                }

                            case CefMenuCommand.Undo:
                                {
                                    browser.FocusedFrame.Undo();
                                    break;
                                }

                            case CefMenuCommand.StopLoad:
                                {
                                    browser.StopLoad();
                                    break;
                                }

                            case CefMenuCommand.SelectAll:
                                {
                                    browser.FocusedFrame.SelectAll();
                                    break;
                                }

                            case CefMenuCommand.Redo:
                                {
                                    browser.FocusedFrame.Redo();
                                    break;
                                }

                            case CefMenuCommand.Find:
                                {
                                    browser.GetHost().Find(0, parameters.SelectionText, true, false, false);
                                    break;
                                }

                            case CefMenuCommand.AddToDictionary:
                                {
                                    browser.GetHost().AddWordToDictionary(parameters.MisspelledWord);
                                    break;
                                }

                            case CefMenuCommand.Reload:
                                {
                                    browser.Reload();
                                    break;
                                }

                            case CefMenuCommand.ReloadNoCache:
                                {
                                    browser.Reload(ignoreCache: true);
                                    break;
                                }

                            case (CefMenuCommand)26501:
                                {
                                    browser.GetHost().ShowDevTools();
                                    break;
                                }

                            case (CefMenuCommand)26502:
                                {
                                    browser.GetHost().CloseDevTools();
                                    break;
                                }
                            }
                        }, keepTargetAlive: true)
                    });
                }
                webBrowser.ContextMenu = menu;
            });

            return(true);
        }
예제 #19
0
        public CommandBarFlyout()
        {
            PrimaryCommands   = new ObservableCollection <ICommandBarElement>();
            SecondaryCommands = new ObservableCollection <ICommandBarElement>();

            PrimaryCommands.CollectionChanged += (object sender, NotifyCollectionChangedEventArgs args) =>
            {
                if (m_commandBar != null)
                {
                    SharedHelpers.ForwardCollectionChange((ObservableCollection <ICommandBarElement>)sender, m_commandBar.PrimaryCommands, args);
                }
            };

            SecondaryCommands.CollectionChanged += (object sender, NotifyCollectionChangedEventArgs args) =>
            {
                var commandBar = m_commandBar;
                if (commandBar != null)
                {
                    var source = (ObservableCollection <ICommandBarElement>)sender;
                    SharedHelpers.ForwardCollectionChange(source, commandBar.SecondaryCommands, args);

                    // We want to ensure that any interaction with secondary items causes the CommandBarFlyout
                    // to close, so we'll attach a Click handler to any buttons and Checked/Unchecked handlers
                    // to any toggle buttons that we get and close the flyout when they're invoked.
                    // The only exception is buttons with flyouts - in that case, clicking on the button
                    // will just open the flyout rather than executing an action, so we don't want that to
                    // do anything.
                    RoutedEventHandler closeFlyoutFunc = delegate { Hide(); };

                    // TODO
                    switch (args.Action)
                    {
                    case NotifyCollectionChangedAction.Replace:
                    {
                        var element      = (ICommandBarElement)args.NewItems[0];
                        var oldElement   = (ICommandBarElement)args.OldItems[0];
                        var button       = element as AppBarButton;
                        var toggleButton = element as AppBarToggleButton;

                        RevokeAndRemove(m_secondaryButtonClickRevokerByElementMap, oldElement);
                        RevokeAndRemove(m_secondaryToggleButtonCheckedRevokerByElementMap, oldElement);
                        RevokeAndRemove(m_secondaryToggleButtonUncheckedRevokerByElementMap, oldElement);

                        if (button != null && button.Flyout == null)
                        {
                            m_secondaryButtonClickRevokerByElementMap[element] = new RoutedEventHandlerRevoker(
                                button, ButtonBase.ClickEvent, closeFlyoutFunc);
                            RevokeAndRemove(m_secondaryToggleButtonCheckedRevokerByElementMap, element);
                            RevokeAndRemove(m_secondaryToggleButtonUncheckedRevokerByElementMap, element);
                        }
                        else if (toggleButton != null)
                        {
                            RevokeAndRemove(m_secondaryButtonClickRevokerByElementMap, element);
                            m_secondaryToggleButtonCheckedRevokerByElementMap[element] = new RoutedEventHandlerRevoker(
                                toggleButton, ToggleButton.CheckedEvent, closeFlyoutFunc);
                            m_secondaryToggleButtonUncheckedRevokerByElementMap[element] = new RoutedEventHandlerRevoker(
                                toggleButton, ToggleButton.UncheckedEvent, closeFlyoutFunc);
                        }
                        else
                        {
                            RevokeAndRemove(m_secondaryButtonClickRevokerByElementMap, element);
                            RevokeAndRemove(m_secondaryToggleButtonCheckedRevokerByElementMap, element);
                            RevokeAndRemove(m_secondaryToggleButtonUncheckedRevokerByElementMap, element);
                        }
                        break;
                    }

                    case NotifyCollectionChangedAction.Add:
                    {
                        var element      = (ICommandBarElement)args.NewItems[0];
                        var button       = element as AppBarButton;
                        var toggleButton = element as AppBarToggleButton;

                        if (button != null && button.Flyout == null)
                        {
                            m_secondaryButtonClickRevokerByElementMap[element] = new RoutedEventHandlerRevoker(
                                button, ButtonBase.ClickEvent, closeFlyoutFunc);
                        }
                        else if (toggleButton != null)
                        {
                            m_secondaryToggleButtonCheckedRevokerByElementMap[element] = new RoutedEventHandlerRevoker(
                                toggleButton, ToggleButton.CheckedEvent, closeFlyoutFunc);
                            m_secondaryToggleButtonUncheckedRevokerByElementMap[element] = new RoutedEventHandlerRevoker(
                                toggleButton, ToggleButton.UncheckedEvent, closeFlyoutFunc);
                        }
                        break;
                    }

                    case NotifyCollectionChangedAction.Remove:
                    {
                        var element = (ICommandBarElement)args.OldItems[0];
                        RevokeAndRemove(m_secondaryButtonClickRevokerByElementMap, element);
                        RevokeAndRemove(m_secondaryToggleButtonCheckedRevokerByElementMap, element);
                        RevokeAndRemove(m_secondaryToggleButtonUncheckedRevokerByElementMap, element);
                        break;
                    }

                    case NotifyCollectionChangedAction.Move:
                        break;

                    case NotifyCollectionChangedAction.Reset:
                        SetSecondaryCommandsToCloseWhenExecuted();
                        break;

                    default:
                        Debug.Assert(false);
                        break;
                    }
                }
            };

            Opening += delegate
            {
                AreOpenCloseAnimationsEnabled = true;

                if (m_commandBar.HasOpenAnimation())
                {
                    InternalPopup.SuppressFadeAnimation = true;
                }
                else
                {
                    InternalPopup.SuppressFadeAnimation = false;
                }

                if (ShowMode == FlyoutShowMode.Standard)
                {
                    m_commandBar.IsOpen = true;
                }
            };

            Opened += delegate
            {
                if (m_commandBar != null)
                {
                    if (m_commandBar.HasOpenAnimation())
                    {
                        m_commandBar.PlayOpenAnimation();
                    }
                    else
                    {
                        AreOpenCloseAnimationsEnabled = false;
                    }
                }
            };

            Closing += delegate
            {
                var commandBar = m_commandBar;
                if (commandBar != null)
                {
                    if (!m_isClosingAfterCloseAnimation && commandBar.HasCloseAnimation())
                    {
                        //args.Cancel(true);

                        commandBar.PlayCloseAnimation(() =>
                        {
                            m_isClosingAfterCloseAnimation = true;
                            Hide();
                            m_isClosingAfterCloseAnimation = false;
                        });
                        commandBar.IsOpen = false;
                    }

                    //CommandBarFlyoutCommandBar.Closed will be called when
                    //clicking the more (...) button, we clear the translations
                    //here
                    commandBar.ClearShadow();
                }
            };

            Closed += delegate
            {
                if (m_commandBar != null)
                {
                    if (m_commandBar.IsOpen)
                    {
                        m_commandBar.IsOpen = false;
                    }
                }
            };
        }
 public MainPage()
 {
     InitializeComponent();
     Loaded += new RoutedEventHandler(MainPage_Loaded);
 }
예제 #21
0
 public MainWindow()
 {
     InitializeComponent();
     ViewModel = new ShellViewModel();
     Loaded   += new RoutedEventHandler(MainWindow_Loaded);
 }
예제 #22
0
 public Example()
 {
     InitializeComponent();
     Loaded += new RoutedEventHandler(HeaderContent_Loaded);
 }
예제 #23
0
        // 각 point에 대한 Changed 함수
        private static void OnPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            var frameworkElement = dependencyObject as FrameworkElement;

            if (frameworkElement == null)
            {
                return;
            }

            var canvas = ViewUtils.GetParent(frameworkElement, (t) => t is Canvas) as Canvas;

            if (canvas == null)
            {
                return;
            }

            var  mousePosition     = Mouse.GetPosition(canvas);
            int  lastMouseMoveTime = Environment.TickCount;
            bool itemIsClicked     = false;

            double lastMousePosX = -1;
            double lastMousePosY = -1;
            double x             = 0;
            double y             = 0;

            RoutedEventHandler mouseDown = RegistredElements.ContainsKey(frameworkElement) ? RegistredElements[frameworkElement].MouseDown : null;
            RoutedEventHandler mouseUp   = RegistredElements.ContainsKey(frameworkElement) ? RegistredElements[frameworkElement].MouseUp : null;
            RoutedEventHandler mouseMove = RegistredElements.ContainsKey(frameworkElement) ? RegistredElements[frameworkElement].MouseMove : null;

            if ((bool)dependencyPropertyChangedEventArgs.NewValue)
            {
                if (!RegistredElements.ContainsKey(frameworkElement))
                {
                    RegistredElements.Add(frameworkElement, new MyHandlersData());
                    RegistredElements[frameworkElement].MouseDown = (_, __) =>
                    {
                        itemIsClicked = true;

                        //always mouse down (start dragging), update the x,y
                        x = (double)frameworkElement.GetValue(Canvas.LeftProperty);
                        y = (double)frameworkElement.GetValue(Canvas.TopProperty);

                        x = double.IsNaN(x) ? 0 : x;
                        y = double.IsNaN(y) ? 0 : y;

                        mousePosition = Mouse.GetPosition(canvas);
                        lastMousePosX = mousePosition.X;
                        lastMousePosY = mousePosition.Y;
                        Mouse.Capture(frameworkElement);
                    };

                    RegistredElements[frameworkElement].MouseUp = (_, __) =>
                    {
                        itemIsClicked = false;
                        Mouse.Capture(null);
                    };

                    RegistredElements[frameworkElement].MouseMove = (_, __) =>
                    {
                        if (itemIsClicked && ((Environment.TickCount - lastMouseMoveTime) > MouseTimeDif))
                        {
                            mousePosition = Mouse.GetPosition(canvas);
                            var containerHeight = (double)canvas.GetValue(FrameworkElement.ActualHeightProperty);
                            var containerWidth  = (double)canvas.GetValue(FrameworkElement.ActualWidthProperty);
                            var mouseDiffX      = mousePosition.X - lastMousePosX;
                            var mouseDiffY      = mousePosition.Y - lastMousePosY;

                            //                                                      if (x + mouseDiffX > 0 && y + mouseDiffY > 0 && (containerWidth <= 0 || (x + mouseDiffX <= containerWidth) && (mousePosition.X <= containerWidth)) && (containerHeight <= 0 || (y + mouseDiffY <= containerHeight && mousePosition.Y <= containerHeight)))
                            //                                                      {
                            //                                                          x = x + mouseDiffX;
                            //                                                          y = y + mouseDiffY;
                            //                                                          frameworkElement.SetValue(Canvas.LeftProperty, x);
                            //                                                          frameworkElement.SetValue(Canvas.TopProperty, y);
                            //                                                     }

                            MainWindow mw = ((MainWindow)Application.Current.MainWindow);
                            if (x + mouseDiffX >= 0 && mousePosition.X >= 0 && (containerWidth <= 0 || (x + mouseDiffX <= containerWidth) && (mousePosition.X <= containerWidth)))
                            {
                                x = x + mouseDiffX;
                                frameworkElement.SetValue(Canvas.LeftProperty, x);

                                if (mw.mirror.IsChecked == true)
                                {
                                    ListBoxItem    sys   = FindSymmetryPoint(frameworkElement);
                                    PointViewModel p_sys = (PointViewModel)(sys.Content);

                                    var mouseDiffX2 = -mouseDiffX;
                                    //var diffX =
                                    //p_sys.X =
                                    sys.SetValue(Canvas.LeftProperty, p_sys.X + mouseDiffX2);
                                }
                            }
                            if (y + mouseDiffY >= 0 && mousePosition.Y >= 0 && (containerHeight <= 0 || (y + mouseDiffY <= containerHeight && mousePosition.Y <= containerHeight)))
                            {
                                y = y + mouseDiffY;
                                frameworkElement.SetValue(Canvas.TopProperty, y);

                                if (mw.mirror.IsChecked == true)
                                {
                                    ListBoxItem    sys   = FindSymmetryPoint(frameworkElement);
                                    PointViewModel p_sys = (PointViewModel)(sys.Content);
                                    sys.SetValue(Canvas.TopProperty, p_sys.Y + mouseDiffY);
                                }
                            }

                            lastMouseMoveTime = Environment.TickCount;
                            lastMousePosX     = mousePosition.X;
                            lastMousePosY     = mousePosition.Y;
                        }
                    };

                    frameworkElement.AddHandler(Mouse.MouseDownEvent, RegistredElements[frameworkElement].MouseDown, true);
                    frameworkElement.AddHandler(Mouse.MouseUpEvent, RegistredElements[frameworkElement].MouseUp, true);
                    frameworkElement.AddHandler(Mouse.MouseMoveEvent, RegistredElements[frameworkElement].MouseMove, false);
                }

                if (mouseDown != null)
                {
                    frameworkElement.RemoveHandler(Mouse.MouseDownEvent, mouseDown);
                }
                if (mouseUp != null)
                {
                    frameworkElement.RemoveHandler(Mouse.MouseUpEvent, mouseUp);
                }
                if (mouseMove != null)
                {
                    frameworkElement.RemoveHandler(Mouse.MouseMoveEvent, mouseMove);
                }
                if (RegistredElements.ContainsKey(frameworkElement))
                {
                    RegistredElements.Remove(frameworkElement);
                }
            }
        }
예제 #24
0
 public DocumentingDBWizard()
 {
     InitializeComponent();
     Loaded += new RoutedEventHandler(DDBWindow_Loaded);
 }
예제 #25
0
        /// <summary>
        /// Sets the owner window of a specific window. It will first try to set the owner via
        /// the <paramref name="ownerWindow"/>. If the <paramref name="ownerWindow"/> is not available,
        /// this method will use the <paramref name="ownerHandle"/> to set the parent.
        /// </summary>
        /// <param name="window">Reference to the current window.</param>
        /// <param name="ownerWindow">New owner window.</param>
        /// <param name="ownerHandle">The owner handle.</param>
        /// <param name="forceNewOwner">If true, the new owner will be forced. Otherwise, if the
        /// window currently has an owner, that owner will be respected (and thus not changed).</param>
        /// <param name="focusFirstControl">If true, the first control will automatically be focused.</param>
        private static void SetOwnerWindow(SystemWindow window, SystemWindow ownerWindow, IntPtr ownerHandle, bool forceNewOwner, bool focusFirstControl)
        {
            if (focusFirstControl)
            {
                window.FocusFirstControl();
            }

            if (!forceNewOwner && HasOwner(window))
            {
                return;
            }

            try
            {
                if (ownerWindow != null)
                {
                    if (ReferenceEquals(ownerWindow, window))
                    {
                        Log.Warning("Cannot set owner window to itself, no owner window set");
                        return;
                    }

                    if (window.Dispatcher.GetThreadId() != ownerWindow.Dispatcher.GetThreadId())
                    {
                        Log.Warning("The owner window '{0}' is not created on the same thread as the current window '{1}', cannot set owner window",
                                    ownerWindow.GetType().GetSafeFullName(), window.GetType().GetSafeFullName());
                        return;
                    }

                    window.Owner = ownerWindow;
                }
                else
                {
                    // Set owner via interop helper
                    var interopHelper = new WindowInteropHelper(window);
                    interopHelper.Owner = ownerHandle;

                    // Get handler (so we can nicely unsubscribe)
                    RoutedEventHandler onWindowLoaded = null;
                    onWindowLoaded = delegate(object sender, RoutedEventArgs e)
                    {
                        // Since this owner type doesn't support WindowStartupLocation.CenterOwner, do
                        // it manually
                        if (window.WindowStartupLocation == WindowStartupLocation.CenterOwner)
                        {
                            // Get the parent window rect
                            RECT ownerRect;
                            if (GetWindowRect(ownerHandle, out ownerRect))
                            {
                                // Get some additional information
                                int ownerWidth            = ownerRect.Right - ownerRect.Left;
                                int ownerHeight           = ownerRect.Bottom - ownerRect.Top;
                                int ownerHorizontalCenter = (ownerWidth / 2) + ownerRect.Left;
                                int ownerVerticalCenter   = (ownerHeight / 2) + ownerRect.Top;

                                // Set the location to manual
                                window.WindowStartupLocation = WindowStartupLocation.Manual;

                                // Now we know the location of the parent, center the window
                                window.Left = ownerHorizontalCenter - (window.ActualWidth / 2);
                                window.Top  = ownerVerticalCenter - (window.ActualHeight / 2);
                            }
                        }

                        ((SystemWindow)sender).Loaded -= onWindowLoaded;
                    };

                    window.Loaded += onWindowLoaded;
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Failed to set the owner window");
            }
        }
예제 #26
0
 public ResizeDecorator()
 {
     Unloaded += new RoutedEventHandler(this.ResizeDecorator_Unloaded);
 }
예제 #27
0
 void AddWarningMessage(PEFile module, ITextOutput output, string line1, string line2 = null,
                        string buttonText = null, System.Windows.Media.ImageSource buttonImage = null, RoutedEventHandler buttonClickHandler = null)
 {
     if (output is ISmartTextOutput fancyOutput)
     {
         string text = line1;
         if (!string.IsNullOrEmpty(line2))
         {
             text += Environment.NewLine + line2;
         }
         fancyOutput.AddUIElement(() => new StackPanel {
             Margin      = new Thickness(5),
             Orientation = Orientation.Horizontal,
             Children    =
             {
                 new Image     {
                     Width  = 32,
                     Height = 32,
                     Source = Images.Load(this, "Images/Warning")
                 },
                 new TextBlock {
                     Margin = new Thickness(5, 0, 0, 0),
                     Text   = text
                 }
             }
         });
         fancyOutput.WriteLine();
         if (buttonText != null && buttonClickHandler != null)
         {
             fancyOutput.AddButton(buttonImage, buttonText, buttonClickHandler);
             fancyOutput.WriteLine();
         }
     }
     else
     {
         WriteCommentLine(output, line1);
         if (!string.IsNullOrEmpty(line2))
         {
             WriteCommentLine(output, line2);
         }
     }
 }
예제 #28
0
        public WpfTraceViewer()
        {
            buttonDockPanel        = new DockPanel();
            buttonDockPanel.Margin = new Thickness(5, 3, 0, 3);
            DockPanel.SetDock(buttonDockPanel, Dock.Bottom);
            Children.Add(buttonDockPanel);

            isRichTextTracingCheckBox                   = new CheckBox();
            isRichTextTracingCheckBox.Content           = "_Rich Text";
            isRichTextTracingCheckBox.Margin            = new Thickness(0, 0, 5, 0);
            isRichTextTracingCheckBox.VerticalAlignment = VerticalAlignment.Center;
            isRichTextTracingCheckBox.Checked          += isRichTextTracingCheckBox_CheckedChanged;
            isRichTextTracingCheckBox.Unchecked        += isRichTextTracingCheckBox_CheckedChanged;
            DockPanel.SetDock(isRichTextTracingCheckBox, Dock.Left);
            buttonDockPanel.Children.Add(isRichTextTracingCheckBox);

            isFilterCheckBox                   = new CheckBox();
            isFilterCheckBox.Content           = "_Filter";
            isFilterCheckBox.Margin            = new Thickness(0, 0, 5, 0);
            isFilterCheckBox.VerticalAlignment = VerticalAlignment.Center;
            //isFilterCheckBox.Checked += isFilterCheckBox_CheckedChanged;
            //isFilterCheckBox.Unchecked += isFilterCheckBox_CheckedChanged;
            DockPanel.SetDock(isFilterCheckBox, Dock.Left);
            buttonDockPanel.Children.Add(isFilterCheckBox);

            var copyAllButton = new Button();

            copyAllButton.Content = "C_opy All";
            copyAllButton.Margin  = new Thickness(0, 0, 5, 0);
            copyAllButton.Click  += copyAllButton_Click;
            DockPanel.SetDock(copyAllButton, Dock.Left);
            buttonDockPanel.Children.Add(copyAllButton);

            var clearAllButton = new Button();

            clearAllButton.Content = "_Clear All";
            clearAllButton.Margin  = new Thickness(0, 0, 5, 0);
            clearAllButton.Click  += clearAllButton_Click;
            DockPanel.SetDock(clearAllButton, Dock.Left);
            buttonDockPanel.Children.Add(clearAllButton);

            var stopContinueButton = new Button();

            stopContinueButton.Content = "Stop";
            stopContinueButton.Margin  = new Thickness(0, 0, 5, 0);
            stopContinueButton.Click  += stopContinueButton_Click;
            DockPanel.SetDock(stopContinueButton, Dock.Left);
            buttonDockPanel.Children.Add(stopContinueButton);

            var dockFillRectangle = new Rectangle();

            dockFillRectangle.HorizontalAlignment = HorizontalAlignment.Stretch;
            buttonDockPanel.Children.Add(dockFillRectangle);

            var tracerGrid = new Grid();

            Children.Add(tracerGrid);


            traceTextBox                               = new TextBox();
            traceTextBox.BorderBrush                   = Brushes.DarkGray;
            traceTextBox.IsReadOnly                    = true;
            traceTextBox.UndoLimit                     = 0;
            traceTextBox.TextWrapping                  = TextWrapping.Wrap;
            traceTextBox.Margin                        = new Thickness(3);
            traceTextBox.HorizontalAlignment           = HorizontalAlignment.Stretch;
            traceTextBox.VerticalAlignment             = VerticalAlignment.Stretch;
            traceTextBox.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            traceTextBox.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;

            traceRichTextBox                               = new RichTextBox();
            traceRichTextBox.BorderBrush                   = Brushes.DarkGray;
            traceRichTextBox.IsReadOnly                    = true;
            traceRichTextBox.UndoLimit                     = 0;
            traceRichTextBox.Margin                        = new Thickness(3);
            traceRichTextBox.HorizontalAlignment           = HorizontalAlignment.Stretch;
            traceRichTextBox.VerticalAlignment             = VerticalAlignment.Stretch;
            traceRichTextBox.VerticalScrollBarVisibility   = ScrollBarVisibility.Visible;
            traceRichTextBox.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
            FlowDocument traceFlowDocument = new FlowDocument();

            traceRichTextBox.Document = traceFlowDocument;
            Table table = new Table();

            traceFlowDocument.Blocks.Add(table);
            Typeface typeface =
                new Typeface(traceRichTextBox.FontFamily, traceRichTextBox.FontStyle, traceRichTextBox.FontWeight, traceRichTextBox.FontStretch);
            var dateFormattedText =
                new FormattedText("00:00.000", CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, typeface, traceRichTextBox.FontSize, Brushes.Black);
            var typeFormattedText =
                new FormattedText("nnn", CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, typeface, traceRichTextBox.FontSize, Brushes.Black);

            table.Columns.Add(new TableColumn {
                Width = new GridLength(dateFormattedText.Width, GridUnitType.Pixel)
            });
            table.Columns.Add(new TableColumn {
                Width = new GridLength(typeFormattedText.Width, GridUnitType.Pixel)
            });
            table.Columns.Add(new TableColumn {
                Width = GridLength.Auto
            });
//      table.Columns.Add(new TableColumn {Width=new GridLength(1, GridUnitType.Star)});
            traceTableRowGroup = new TableRowGroup();
            table.RowGroups.Add(traceTableRowGroup);

            initTraceTextBox();
            tracerGrid.Children.Add(traceTextBox);
            tracerGrid.Children.Add(traceRichTextBox);
            configureTextTracing();

            setTraceAction(addTraceLine);
            Loaded += new RoutedEventHandler(WpfTraceViewer_Loaded);
        }
예제 #29
0
 public static void RemoveLoadedHandler(DependencyObject d, RoutedEventHandler handler)
 {
     (d as UIElement)?.RemoveHandler(LoadedEvent, handler);
 }
예제 #30
0
 public EditProject()
 {
     Loaded += new RoutedEventHandler(EditProject_Loaded);
     InitializeComponent();
 }
예제 #31
0
        public Button CreateBtn(string content, string name, int height = 0, int width = 0, RoutedEventHandler function = null, string btnStyle = null)
        {
            Button btn = new Button()
            {
                Content = content,
                Name    = name
            };

            if (height > 0 && width > 0)
            {
                btn.Height   = height;
                btn.Width    = width;
                btn.FontSize = 18;
            }
            if (function != null)
            {
                btn.Click += function;
            }
            if (!String.IsNullOrEmpty(btnStyle))
            {
                btn.Style = (Style)TryFindResource(btnStyle);
            }
            return(btn);
        }
        public void CreateItmeToContextMenu(string itemName, ContextMenu contextMenu, RoutedEventHandler handler)
        {
            MenuItem item = new MenuItem();

            item.Name       = "MenuItem_SkeletonTreeViewOperation_ContextMenu_" + itemName;
            item.Header     = itemName;
            item.Foreground = Brushes.White;
            item.Click     += handler;
            contextMenu.Items.Add(item);
        }
예제 #33
0
        bool IContextMenuHandler.RunContextMenu(
            IWebBrowser chromiumWebBrowser,
            IBrowser browser,
            IFrame frame,
            IContextMenuParams parameters,
            IMenuModel model,
            IRunContextMenuCallback callback)
        {
            //NOTE: Return false to use the built in Context menu -
            // in WPF this requires you integrate into your existing message loop,
            // read the General Usage Guide for more details
            //https://github.com/cefsharp/CefSharp/wiki/General-Usage#multithreadedmessageloop
            //return false;

            var webBrowser = (ChromiumWebBrowser)chromiumWebBrowser;

            //IMenuModel is only valid in the context of this method,
            // so need to read the values before invoking on the UI thread
            var menuItems = GetMenuItems(model).ToList();

            webBrowser.Dispatcher.Invoke(() =>
            {
                var menu = new ContextMenu
                {
                    IsOpen = true
                };

                RoutedEventHandler handler = null;

                handler = (s, e) =>
                {
                    menu.Closed -= handler;

                    //If the callback has been disposed then it's already been executed
                    //so don't call Cancel
                    if (!callback.IsDisposed)
                    {
                        callback.Cancel();
                    }
                };

                menu.Closed += handler;

                foreach (var item in menuItems)
                {
                    if (item.Item2 == CefMenuCommand.NotFound &&
                        string.IsNullOrWhiteSpace(item.Item1))
                    {
                        menu.Items.Add(new Separator());
                        continue;
                    }

                    menu.Items.Add(new MenuItem
                    {
                        Header    = item.Item1.Replace("&", "_"),
                        IsEnabled = item.Item3,
                        Command   = new RelayCommand(() =>
                                                     ProcessMenu(item, browser, parameters),
                                                     keepTargetAlive: true)
                    });
                }
                webBrowser.ContextMenu = menu;
            });

            return(true);
        }
 // If the routed event type matches one the element listening on then add handler to the event route.
 internal static void AddHandlerToRoute(DependencyObject o, EventRoute route, RoutedEventHandler eventHandler, bool handledToo)
 {
     // Add a synchronized input handler to the route.
     route.Add(o, eventHandler, handledToo);
 }
예제 #35
0
 /// <summary>
 ///     Removes a handler for the LostFocus attached event
 /// </summary>
 /// <param name="element">UIElement or ContentElement that listens to this event</param>
 /// <param name="handler">Event Handler to be removed</param>
 public static void RemoveLostFocusHandler(DependencyObject element, RoutedEventHandler handler)
 {
     UIElement.RemoveHandler(element, LostFocusEvent, handler);
 }
예제 #36
0
        private void AddSubMenuItem(MenuItem parentMenuItem, string itemHeader, object itemTag, RoutedEventHandler clickEventHandler, int insertIndex, string toolTip = "", eImageType iconType = eImageType.Null)
        {
            MenuItem subMenuItem = new MenuItem();

            subMenuItem.Style  = (Style)TryFindResource("$MenuItemStyle_ButtonSubMenuItem");
            subMenuItem.Header = itemHeader;
            subMenuItem.Tag    = itemTag;
            subMenuItem.Click += clickEventHandler;
            if (!string.IsNullOrEmpty(toolTip))
            {
                subMenuItem.ToolTip = toolTip;
            }
            if (iconType != eImageType.Null)
            {
                //< usercontrols:ImageMakerControl SetAsFontImageWithSize = "16" ImageType = "Edit" />
                ImageMakerControl imageMaker = new ImageMakerControl();
                imageMaker.SetAsFontImageWithSize = 16;
                imageMaker.ImageType = iconType;
                subMenuItem.Icon     = imageMaker;
            }
            parentMenuItem.Items.Insert(insertIndex, subMenuItem);
        }
예제 #37
0
 public void AddToolbarTool(eImageType imageType, string toolTip = "", RoutedEventHandler clickHandler = null, Visibility toolVisibility = System.Windows.Visibility.Visible, object CommandParameter = null)
 {
     //no tool bar to add to in this View type
 }
예제 #38
0
 /// <summary>
 ///     Adds a handler for the GotFocus attached event
 /// </summary>
 /// <param name="element">UIElement or ContentElement that listens to this event</param>
 /// <param name="handler">Event Handler to be added</param>
 public static void AddGotFocusHandler(DependencyObject element, RoutedEventHandler handler)
 {
     UIElement.AddHandler(element, GotFocusEvent, handler);
 }
예제 #39
0
 public GameStart()
 {
     // 为初始化变量所必需
     InitializeComponent();
     Loaded += new RoutedEventHandler(GameStart_Loaded);
 }
예제 #40
0
        private void addMenuItem(String groupKey, String menuName, String caption, String img, int grp, String criteria, String accessRight, RoutedEventHandler evt, String productHopper)
        {
            ArrayList tempArr = new ArrayList();

            if (menuMaps.Contains(groupKey))
            {
                tempArr = (ArrayList)menuMaps[groupKey];
            }
            else
            {
                menuMaps.Add(groupKey, tempArr);
            }

            MMenuItem mni = addMenuItemConfig(menuName, criteria, accessRight);

            mni.Group         = grp.ToString();
            mni.Caption       = caption;
            mni.Image         = img;
            mni.MenuEvent     = evt;
            mni.ProductHopper = productHopper;

            tempArr.Add(mni);
        }
예제 #41
0
 public WarehouseOwnerMaintain()
 {
     InitializeComponent();
     Loaded += new RoutedEventHandler(WarehouseOwnerMaintain_Loaded);
 }
예제 #42
-1
 public CampaignView()
 {
     InitializeComponent();
     InitializeStatusList();
     _cleverCallCenter = new CleverCallCenter();
     Loaded+=new RoutedEventHandler(CampaignView_Loaded);
 }
예제 #43
-1
        public ThreadPage()
        {
            InitializeComponent();
            _PinButton = ApplicationBar.Buttons[2] as Microsoft.Phone.Shell.ApplicationBarIconButton;

            Loaded += new RoutedEventHandler(ThreadPage_Loaded);
        }
예제 #44
-1
        public GruppenGrid()
        {
            InitializeComponent();
            Mannschaften = new List<Mannschaft>();

            Loaded += new RoutedEventHandler(GruppenGrid_Loaded);
        }
예제 #45
-1
        public MainWindow()
        {
            InitializeComponent();

            Loaded += new RoutedEventHandler(MainWindow_Loaded);
            btnLogin.Click += new RoutedEventHandler(btnLogin_Click);
        }
		public DebuggerTooltipControl(Location logicalPosition)
		{
			this.logicalPosition = logicalPosition;
			InitializeComponent();
			
			Loaded += new RoutedEventHandler(OnLoaded);
		}
예제 #47
-1
 public MainWindow()
 {
     InitializeComponent();
     Loaded += new RoutedEventHandler(MainWindow_Loaded);
     this.ViewModel = new MainWindowViewModel();
     this.DataContext = this.ViewModel;
 }
예제 #48
-1
        public CalendarPage()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(FirstLook_Loaded);

            loadData();
        }
예제 #49
-1
 public void ucConfigure(int _mode, int? _PID)
 {
     ucMode = _mode;
     ucPID = _PID;
     switchUCmode(ucMode);
     Loaded += new RoutedEventHandler(uc_ProducerType_Loaded);
 }
예제 #50
-1
        public uc_CalibrationList()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(uc_CalibrationList_Loaded);

            txt_reportPath.Text = String.Format("{0}report=Report_Calibrations", SIT_Report.ReportPageModel.GetBaseAddress());
        }
예제 #51
-1
        public static object showTmplGroup(string addStr, ItemsControl itemFrame, RoutedEventHandler rehClick, string rowId = "")
        {
            object retItemFrame = null;

            if (MainWindow.s_pW.m_docConf.SelectSingleNode("Config").SelectSingleNode("template") != null &&
                MainWindow.s_pW.m_docConf.SelectSingleNode("Config").SelectSingleNode("template").SelectSingleNode(addStr + "Tmpls") != null)
            {
                XmlElement xeTmpls = (XmlElement)MainWindow.s_pW.m_docConf.SelectSingleNode("Config").
                    SelectSingleNode("template").SelectSingleNode(addStr + "Tmpls");
                retItemFrame = showTmpl(itemFrame, xeTmpls, addStr, rehClick, rowId);
            }

            if (Project.Setting.s_docProj.SelectSingleNode("BoloUIProj").SelectSingleNode("template") != null &&
                Project.Setting.s_docProj.SelectSingleNode("BoloUIProj").SelectSingleNode("template").SelectSingleNode(addStr + "Tmpls") != null)
            {
                XmlElement xeTmpls = (XmlElement)Project.Setting.s_docProj.SelectSingleNode("BoloUIProj").
                    SelectSingleNode("template").SelectSingleNode(addStr + "Tmpls");
                object ret = showTmpl(itemFrame, xeTmpls, addStr, rehClick, rowId);

                if (ret != null)
                {
                    retItemFrame = ret;
                }
            }

            return retItemFrame;
        }
예제 #52
-1
 public frmcatint(string usr)
 {
     InitializeComponent();
     EntityQuery<tram_vt> Query = dstb.GetTram_vtQuery();
     LoadOp = dstb.Load(Query.Where(t => App.ma_huyen.Contains(t.ma_huyen)).OrderBy(p => p.ten_tram), LoadOpT_Complete, null);
     //QLThuebaoDomainContext tramvt = new QLThuebaoDomainContext();
     EntityQuery<khmai> Querykm = dstb.GetKhmaiQuery();
     LoadOpkm = dstb.Load(Querykm.OrderByDescending(t => t.ngay_bd), LoadOpTK_Complete, null);
     EntityQuery<mlydocat> Querycat = dstb.GetLyDoCatTrimQuery();
     LoadOpcat = dstb.Load(Querycat.OrderBy(p => p.m_order), LoadOpCT_Complete, null);
     EntityQuery<loaikh> Queryloai = dstb.GetLoaikhQuery();
     LoadOpkh = dstb.Load(Queryloai, LoadOpKH_Complete, null);
     EntityQuery<nganh_nghe> QueryN = dstb.GetNganh_ngheQuery();
     LoadOpN = dstb.Load(QueryN, LoadOpN_Complete, null);
     EntityQuery<loai_dv> Queryloaidv = dstb.GetLoai_dvQuery();
     LoadOpdv = dstb.Load(Queryloaidv, LoadOpDV_Complete, null);            
     EntityQuery<KhachHangUuTien> Queryut = dstb.GetKhachHangUuTienTrimQuery();
     LoadOput = dstb.Load(Queryut.OrderBy(p => p.kh_uutien1), LoadOpUT_Complete, null);
     EntityQuery<nv_thuethu> Queryt = dstb.GetNv_thuethuQuery();
     LoadOptuyen = dstb.Load(Queryt.Where(p => p.ma_huyen == App.ma_huyen).OrderBy(p => p.ten), LoadOpTT_Complete, null);
     //this.txtsdt.MaxLength = App.len_sdt;
     m_usr = usr;
     dngaycat.EditValue = App.Current_d;           
     mlydo.IsEnabled = false;
     Loaded += new RoutedEventHandler(frmeditmy_Loaded);  
     //frmdc = new frmdiachi();
     //frmdc.Closed += new EventHandler(frmdiachi_Closed); 
    
 }
예제 #53
-1
 /// <summary>
 /// Initializes a new instance of the <see cref="Odometer"/> class.
 /// </summary>
 public Odometer()
 {
     InitializeComponent();
     Loaded += new RoutedEventHandler(this.Odometer_Loaded);
     this.timer.Interval = new TimeSpan(0, 0, 0, 0, 750);
     this.timer.Tick += new EventHandler(this.Timer_Tick);
 }
예제 #54
-1
        /// <summary>
        /// 加载菜单项
        /// </summary>
        /// <param name="menuName">菜单名称</param>
        /// <param name="imageUrl">图片</param>
        /// <param name="eventHandler">处理事件</param>
        /// <returns></returns>
        Grid AddMenuItem(string menuName, string imageUrl, RoutedEventHandler eventHandler)
        {
            Grid grid = new Grid();// { Margin = new Thickness(1) };
            grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(25) });
            grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(80) });
            grid.Children.Add(new Rectangle() { Fill = new SolidColorBrush(Color.FromArgb(255, 233, 238, 238)) });
            grid.Children.Add(new Rectangle() { Fill = new SolidColorBrush(Color.FromArgb(255, 226, 228, 231)), HorizontalAlignment = HorizontalAlignment.Right, Width = 1 });

            Button roButton = new Button()
            {
                Height = 22,
                Margin = new Thickness(0, 0, 0, 0),
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Top,
                HorizontalContentAlignment = HorizontalAlignment.Left,
                Style = Application.Current.Resources["ContextMenuButton"] as Style
            };
            roButton.Click += eventHandler;

            Grid.SetColumnSpan(roButton, 2);
            StackPanel sp = new StackPanel() { Orientation = Orientation.Horizontal };
            Image roImage = new Image() { HorizontalAlignment = HorizontalAlignment.Left, Width = 16, Height = 16, Margin = new Thickness(1, 0, 0, 0) };
            roImage.Source = new BitmapImage(new Uri("/HaoRan.WebCam;component/" + imageUrl, UriKind.RelativeOrAbsolute));
            sp.Children.Add(roImage);
            sp.Children.Add(new TextBlock() { HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(16, 0, 0, 0), Text = menuName });

            roButton.Content = sp;
            grid.Children.Add(roButton);
            return grid;
        }
예제 #55
-1
        public SetPassCode()
        {
            InitializeComponent();
            this.SubClassPage = this;

            Loaded += new RoutedEventHandler(MainPage_Loaded);
        }
예제 #56
-1
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            DataContext = new TaskListViewModel();
            Loaded += new RoutedEventHandler(MainPage_Loaded);
        }
예제 #57
-1
        public InputWizardUserControl()
        {
            InitializeComponent();
            Initialize();
            //Controls Events
            Loaded += new RoutedEventHandler(InputWizard_Loaded);

            #if !SILVERLIGHT
            ButtonBrowseConfigurationFile.Content = new BitmapImage(new Uri(@"images/Browse.png", UriKind.Relative));
            ButtonBrowseConnectionFile.Content = new BitmapImage(new Uri(@"images/Browse.png", UriKind.Relative));
            ButtonBrowseIniFile.Content = new BitmapImage(new Uri(@"images/Browse.png", UriKind.Relative));
            ButtonNext.Content = new BitmapImage(new Uri(@"images/Next.png", UriKind.Relative));
            ButtonPrevious.Content = new BitmapImage(new Uri(@"images/Previous.png", UriKind.Relative));
            //ButtonRequestConfiguration.Content = new BitmapImage(new Uri(@"images/RequestData.png", UriKind.Relative));
            ButtonBuildConnectionString.Content = new BitmapImage(new Uri(@"images/Add.png", UriKind.Relative));
            ButtonBuildCommandChannel.Content = new BitmapImage(new Uri(@"images/Add.png", UriKind.Relative));
            #else
            ButtonManualConfiguration.Visibility = Visibility.Collapsed;
            #endif
            ButtonBrowseConfigurationFile.Click += new RoutedEventHandler(ButtonBrowseConfigurationFile_Click);
            ButtonBrowseConnectionFile.Click += new RoutedEventHandler(ButtonBrowseConnectionFile_Click);
            ButtonBrowseIniFile.Click += new RoutedEventHandler(ButtonBrowseIniFile_Click);
            ButtonNext.Click += new RoutedEventHandler(ButtonNext_Click);
            ButtonPrevious.Click += new RoutedEventHandler(ButtonPrevious_Click);
            ButtonRequestConfiguration.Click += new RoutedEventHandler(ButtonRequestConfiguration_Click);
            ButtonBuildConnectionString.Click += new RoutedEventHandler(ButtonBuildConnectionString_Click);
            ButtonBuildCommandChannel.Click += new RoutedEventHandler(ButtonBuildCommandChannel_Click);
            AccordianWizard.SelectionChanged += new SelectionChangedEventHandler(AccordianWizard_SelectionChanged);
            CheckboxConnectToPDC.Checked += new RoutedEventHandler(CheckboxConnectToPDC_Checked);
            CheckboxConnectToPDC.Unchecked += new RoutedEventHandler(CheckboxConnectToPDC_Unchecked);
            ComboboxProtocol.SelectionChanged += new SelectionChangedEventHandler(ComboboxProtocol_SelectionChanged);
        }
 public static ContextMenu StartAndEndNodeContextMenu(RoutedEventHandler removeEventHandler)
 {
     Builder.AddMenuItem("RemovePointMenuItem", "Remove Point", removeEventHandler);
     var result = Builder.Get("StartAndEndNodeContextMent");
     Builder.Clear();
     return result;
 }
예제 #59
-1
 public Window1()
 {
     InitializeComponent();
     InitWin();
     InitIcon();
     Loaded += new RoutedEventHandler(Window1_Loaded);
 }
예제 #60
-1
 public LoadPage()
 {
     InitializeComponent();
     Loaded += new RoutedEventHandler(Scene1_Loaded);
     Storyboard1.Completed += new EventHandler(Storyboard1_Completed);
     SB_Timer.Completed += new EventHandler(SB_Timer_Completed);
 }