Example #1
0
        public WatchView()
        {
            InitializeComponent();

            MouseRightButtonUp          += new System.Windows.Input.MouseButtonEventHandler(view_MouseRightButtonUp);
            PreviewMouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(view_PreviewMouseRightButtonDown);
        }
Example #2
0
 public void enableLink(SymLink link)
 {
     MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(
         delegate(object sender, System.Windows.Input.MouseButtonEventArgs args)
     {
         try
         {
             NavigateTo(link.filename, link.line, link.column);
         }
         catch { }
     });
     MouseEnter += new System.Windows.Input.MouseEventHandler(
         delegate(object sender, System.Windows.Input.MouseEventArgs args)
     {
         TextDecorations.Add(System.Windows.TextDecorations.Underline);
     });
     MouseLeave += new System.Windows.Input.MouseEventHandler(
         delegate(object sender, System.Windows.Input.MouseEventArgs args)
     {
         foreach (var td in System.Windows.TextDecorations.Underline)
         {
             TextDecorations.Remove(td);
         }
     });
 }
        public void CreateBtn(WrapPanel grid, string btnName, System.Windows.Input.MouseButtonEventHandler handler)
        {
            var sp = new StackPanel();

            sp.Margin      = new Thickness(10, 5, 0, 0);
            sp.Width       = 100;
            sp.Orientation = Orientation.Horizontal;

            var border = new Border();

            border.Width = 30;
            var         url    = System.IO.Path.GetDirectoryName(typeof(Project.G.MainWindow).Assembly.Location);
            BitmapImage bitmap = new BitmapImage(new Uri(url + "/img/组件.png", UriKind.RelativeOrAbsolute));
            var         Img    = new Image();

            Img.Source   = bitmap; // "";
            border.Child = Img;
            sp.Children.Add(border);

            var tlb = new TextBlock();

            tlb.Text                = btnName;
            tlb.Margin              = new Thickness(10, 0, 0, 0);
            tlb.VerticalAlignment   = VerticalAlignment.Center;
            tlb.HorizontalAlignment = HorizontalAlignment.Center;
            tlb.Foreground          = MainWindow.GetColor("#1e1e1e");
            sp.Children.Add(tlb);
            sp.MouseLeftButtonDown += handler;
            grid.Children.Add(sp);
        }
Example #4
0
        void Initialize()
        {
            this.InitializeComponent();

            MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(onClick);
            Margin = new Thickness(ITEM_WIDTH * NumItems, 0, 0, 0);
            Select = (Storyboard)FindResource("Select");
            DeSelect = (Storyboard)FindResource("DeSelect");
            NumItems++;
        }
        void WatchViewFullscreen_Loaded(object sender, RoutedEventArgs e)
        {
            MouseLeftButtonDown         += new System.Windows.Input.MouseButtonEventHandler(view_MouseButtonIgnore);
            MouseLeftButtonUp           += new System.Windows.Input.MouseButtonEventHandler(view_MouseButtonIgnore);
            MouseRightButtonUp          += new System.Windows.Input.MouseButtonEventHandler(view_MouseRightButtonUp);
            PreviewMouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(view_PreviewMouseRightButtonDown);

            var mi = new MenuItem {
                Header = "Zoom to Fit"
            };

            mi.Click += new RoutedEventHandler(mi_Click);

            MainContextMenu.Items.Add(mi);

            dynSettings.Controller.RequestsRedraw += new System.EventHandler(Controller_RequestsRedraw);
            dynSettings.Controller.RunCompleted   += new DynamoController.RunCompletedHandler(Controller_RunCompleted);
            _vm = DataContext as Watch3DFullscreenViewModel;
        }
Example #6
0
 public void enableLink()
 {
     MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(
         delegate(object sender, System.Windows.Input.MouseButtonEventArgs args)
     {
         // Text = "clicked!";
     });
     MouseEnter += new System.Windows.Input.MouseEventHandler(
         delegate(object sender, System.Windows.Input.MouseEventArgs args)
     {
         TextDecorations.Add(System.Windows.TextDecorations.Underline);
     });
     MouseLeave += new System.Windows.Input.MouseEventHandler(
         delegate(object sender, System.Windows.Input.MouseEventArgs args)
     {
         foreach (var td in System.Windows.TextDecorations.Underline)
         {
             TextDecorations.Remove(td);
         }
     });
 }
Example #7
0
 public PhotoGalleryItemControl()
 {
     DefaultStyleKey    = typeof(PhotoGalleryItemControl);
     MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(OnMouseButtonUp);
 }
Example #8
0
 public TestMultipleVideosChangingReuseMediaUriElement()
 {
     InitializeComponent();
     MouseDoubleClick     += new System.Windows.Input.MouseButtonEventHandler(TestMultipleVideosChangingReuseMediaUriElement_MouseDoubleClick);
     MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(TestMultipleVideosChangingReuseMediaUriElement_MouseRightButtonDown);
 }
        public MapLayer CreatePinPlaces(System.Collections.ObjectModel.ObservableCollection <GooglePlacesApi.Place> place, System.Windows.Input.MouseButtonEventHandler handler)
        {
            MapLayer unitsLayer = new MapLayer();

            for (int i = 0; i < place.Count; i++)
            {
                var pin = new Pushpin();
                pin.GeoCoordinate      = new System.Device.Location.GeoCoordinate(place[i].Geometry.Location.Lat, place[i].Geometry.Location.Lng);
                pin.Content            = place[i].Name;
                pin.MouseLeftButtonUp += handler;
                pin.Style              = (Style)App.Current.Resources["PlacePinStyle"];
                MapOverlay LocationOverlay = new MapOverlay();
                LocationOverlay.Content        = pin;
                LocationOverlay.PositionOrigin = new Point(0.7, 0.7);
                LocationOverlay.GeoCoordinate  = new System.Device.Location.GeoCoordinate(place[i].Geometry.Location.Lat, place[i].Geometry.Location.Lng);
                unitsLayer.Add(LocationOverlay);
            }

            return(unitsLayer);
        }
Example #10
0
 public TestMultipleVideosChangingReuseMediaUriElement()
 {
     InitializeComponent();
     MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(TestMultipleVideosChangingReuseMediaUriElement_MouseDoubleClick);
     MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(TestMultipleVideosChangingReuseMediaUriElement_MouseRightButtonDown);
 }
Example #11
0
 private void LoadFunctionTree(System.Windows.Controls.TreeView FunctionTree,
     DataTable FuntionDescriptionsParameter)
     {
     FuntionDescriptions = FuntionDescriptionsParameter;
     FunctionTree.Items.Clear();
     foreach (DataRow RootEntry in FuntionDescriptions.Rows)
         {
         ContextMenuEventHandler ContextHandler = new ContextMenuEventHandler(ItemToInsert_ContextMenuOpening);
         System.Windows.Input.MouseButtonEventHandler MouseDouble =
             new System.Windows.Input.MouseButtonEventHandler(ItemToInsert_MouseDoubleClick);
         if ((RootEntry["ParentID"] == Convert.DBNull)
             || (((System.Guid) RootEntry["ParentID"]) == System.Guid.Empty))
             {
             TreeViewItem RootItem = new TreeViewItem();
             RootItem.Header = RootEntry["Description"].ToString();
             RootItem.Tag = RootEntry;
             RootItem.ToolTip = RootEntry["ToolTip"].ToString();
             FunctionTree.Items.Add(RootItem);
             LoadFunctionTreeLoop(RootItem, ContextHandler, MouseDouble);
             }
         }
     }
Example #12
0
 public XDataGrid()
 {
     SelectionChanged += new SelectionChangedEventHandler(DataGrid_SelectionChanged);
     PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(DataGrid_PreviewMouseDown);
     MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(DataGrid_MouseDoubleClick);
 }