當前位置: 首頁>>代碼示例>>C#>>正文


C# Controls.Viewbox類代碼示例

本文整理匯總了C#中System.Windows.Controls.Viewbox的典型用法代碼示例。如果您正苦於以下問題:C# Viewbox類的具體用法?C# Viewbox怎麽用?C# Viewbox使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Viewbox類屬於System.Windows.Controls命名空間,在下文中一共展示了Viewbox類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnApplyTemplate

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _viewbox = Template.FindName("ViewBoxInternal", this) as Viewbox;
            _label = Template.FindName("TextBlockInternal", this) as TextBlock;
        }
開發者ID:dbremner,項目名稱:ScreenToGif,代碼行數:7,代碼來源:ImageRadioButton.cs

示例2: AddCustomTab

        public void AddCustomTab(TabControl parentTabControl, string name, UserControl userControl, bool useViewBox = true)
        {
            if (useViewBox)
            {
                Viewbox viewBox = new Viewbox();
                viewBox.Child = userControl;
                viewBox.Width = double.NaN;
                viewBox.Height = double.NaN;

                TabItem tabItem = new TabItem();
                tabItem.Header = name;
                tabItem.Content = viewBox;
                CopyFontData(tabItem1, tabItem);
                parentTabControl.Items.Add(tabItem);
            }
            else
            {
                userControl.Width = double.NaN;
                userControl.Height = double.NaN;
                userControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                userControl.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;

                Grid grid = new Grid();
                grid.Width = double.NaN;
                grid.Height = double.NaN;
                grid.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                grid.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;

                grid.Children.Add(userControl);
                Grid.SetColumn(userControl, 0);
                Grid.SetRow(userControl, 0);

                AddCustomTab(parentTabControl, name, grid);
            }
        }
開發者ID:vesteksoftware,項目名稱:VT5021,代碼行數:35,代碼來源:ManualExtended.cs

示例3: AddGame

 public void AddGame(GameModel game)
 {
     var gameControl = new GameControl {Style = GameStyle, DataContext = game};
     var viewbox = new Viewbox {Style = GameViewBoxStyle};
     viewbox.Child = gameControl;
     Grid.Children.Add(viewbox);
 }
開發者ID:zeldafreak,項目名稱:Area51,代碼行數:7,代碼來源:GamePage.xaml.cs

示例4: switch

 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.viewbox1 = ((System.Windows.Controls.Viewbox)(target));
     return;
     case 2:
     
     #line 10 "..\..\Window1.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);
     
     #line default
     #line hidden
     return;
     case 3:
     
     #line 11 "..\..\Window1.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
     
     #line default
     #line hidden
     return;
     case 4:
     
     #line 12 "..\..\Window1.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
開發者ID:NCCUCS-Windows-Programming,項目名稱:FruitMan,代碼行數:33,代碼來源:Window1.g.i.cs

示例5: UpdateSize

 public static void UpdateSize(FrameworkElement element, double availableWidth)
 {
     var vbox = new Viewbox { Child = element };
     vbox.Measure(new Size(availableWidth, 2000));
     vbox.Arrange(new Rect(0, 0, availableWidth, 2000));
     vbox.UpdateLayout();
 }
開發者ID:modulexcite,項目名稱:printengine,代碼行數:7,代碼來源:UIUtil.cs

示例6: ZoomInstrument

        public static void ZoomInstrument(MouseWheelEventArgs e, Viewbox vb) {
            double delta = e.Delta;
            double factor = delta > 0 ? delta / 100 : (100 / -delta);

            vb.Width = vb.ActualWidth * factor;
            vb.Height = vb.ActualHeight * factor;

        }
開發者ID:ychost,項目名稱:PowerControlSimulation,代碼行數:8,代碼來源:IInst_FrontPanel.cs

示例7: SetScaleFactor

        public static void SetScaleFactor(double scaleFactor,UserControl equi,Viewbox vb) {
            Point disPoint = new Point();
            disPoint.X = (scaleFactor - 1.0) * vb.ActualWidth / 2 ;
            disPoint.Y = (scaleFactor - 1.0) * vb.ActualHeight / 2;
            vb.Width = vb.ActualWidth * scaleFactor;
            vb.Height = vb.ActualHeight * scaleFactor;

        //setDisplacement(equi,disPoint);
        }
開發者ID:ychost,項目名稱:PowerControlSimulation,代碼行數:9,代碼來源:EquipmentScaleUtilis.cs

示例8: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/AppliDemo;component/UserControlStars.xaml", System.UriKind.Relative));
     this.userControlStars = ((System.Windows.Controls.UserControl)(this.FindName("userControlStars")));
     this.LayoutRoot = ((System.Windows.Controls.Viewbox)(this.FindName("LayoutRoot")));
     this.StarRegularPolygon = ((Microsoft.Expression.Shapes.RegularPolygon)(this.FindName("StarRegularPolygon")));
 }
開發者ID:Jordan-Bustos,項目名稱:AppliWindowsPhoneDemo,代碼行數:10,代碼來源:UserControlStars.g.i.cs

示例9: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/LocalD;component/Pages/CameraPage.xaml", System.UriKind.Relative));
     this.CameraViewbox = ((System.Windows.Controls.Viewbox)(this.FindName("CameraViewbox")));
     this.ViewfinderCanvas = ((System.Windows.Controls.Canvas)(this.FindName("ViewfinderCanvas")));
     this.ViewfinderBrush = ((System.Windows.Media.VideoBrush)(this.FindName("ViewfinderBrush")));
 }
開發者ID:kfwls,項目名稱:LocalD,代碼行數:10,代碼來源:CameraPage.g.i.cs

示例10: Setup

		public void Setup()
		{
			TestPanel.Width = 100;
			TestPanel.Height = 100;
			Child = new LayoutPoker ();
			Viewbox = new Viewbox();

			// The default template is applied when the item is added to the tree.
			TestPanel.Children.Add(Viewbox);
			TestPanel.Children.Clear();

			Viewbox.Child = Child;
		}
開發者ID:kangaroo,項目名稱:moon,代碼行數:13,代碼來源:ViewBoxTest.cs

示例11: ImageSourceChanged

        private void ImageSourceChanged(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            ((Image)_currentInvisible.Child).Source = ImageSource;
            FadeImage(_currentInvisible, FadeDuration, 1.0);
            FadeImageInstant(_currentVisible, FadeDuration, 0.0);

            SetZIndex(_currentInvisible, FadeDuration, 1);
            SetZIndex(_currentVisible, FadeDuration, 2);

            Viewbox tmp = _currentInvisible;
            _currentInvisible = _currentVisible;
            _currentVisible = tmp;
        }
開發者ID:DarthAffe,項目名稱:HikariLauncher,代碼行數:13,代碼來源:FadingImageControl.xaml.cs

示例12: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PruebaPaneles;component/View/NodoCuadrado.xaml", System.UriKind.Relative));
     this.rectangle1 = ((System.Windows.Shapes.Rectangle)(this.FindName("rectangle1")));
     this.vbIcono1 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono1")));
     this.vbIcono2 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono2")));
     this.btLinkDiagram = ((System.Windows.Controls.Button)(this.FindName("btLinkDiagram")));
     this.vbIcono3 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono3")));
     this.btLink = ((System.Windows.Controls.Button)(this.FindName("btLink")));
     this.tbTitulo = ((System.Windows.Controls.TextBox)(this.FindName("tbTitulo")));
 }
開發者ID:faelazo,項目名稱:MindGenerator,代碼行數:14,代碼來源:NodoCuadrado.g.i.cs

示例13: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PruebaPaneles;component/View/NodoCirculo.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.elipse = ((System.Windows.Shapes.Ellipse)(this.FindName("elipse")));
     this.tbTitulo = ((System.Windows.Controls.TextBox)(this.FindName("tbTitulo")));
     this.vbIcono1 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono1")));
     this.vbIcono2 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono2")));
     this.btLink = ((System.Windows.Controls.Button)(this.FindName("btLink")));
     this.btLinkDiagram = ((System.Windows.Controls.Button)(this.FindName("btLinkDiagram")));
 }
開發者ID:faelazo,項目名稱:MindGenerator,代碼行數:14,代碼來源:NodoCirculo.g.cs

示例14: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PruebaPaneles;component/View/NodoTriangulo.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.triangle = ((Microsoft.Expression.Shapes.RegularPolygon)(this.FindName("triangle")));
     this.lbTitulo = ((System.Windows.Controls.TextBox)(this.FindName("lbTitulo")));
     this.cvIcono1 = ((System.Windows.Controls.Viewbox)(this.FindName("cvIcono1")));
     this.cvIcono2 = ((System.Windows.Controls.Viewbox)(this.FindName("cvIcono2")));
     this.btLink = ((System.Windows.Controls.Button)(this.FindName("btLink")));
     this.btLinkDiagram = ((System.Windows.Controls.Button)(this.FindName("btLinkDiagram")));
 }
開發者ID:faelazo,項目名稱:MindGenerator,代碼行數:14,代碼來源:NodoTriangulo.g.i.cs

示例15: goNext

        private void goNext()
        {
            string next = globalDatasingleton.getInstance().getNext();
            if (next == null) return;
            if (next == "") return;

            MyImage img = new MyImage();
            img.OriginalPath = next;
            img.Source = new BitmapImage(new Uri(next));
            Viewbox vb = new Viewbox { Width = 200, Child = img };

            LoadVBox(ref vb);
            //LoadVBox(ref next);
        }
開發者ID:zebulon75018,項目名稱:photochoicetouch,代碼行數:14,代碼來源:onePhotoPage.xaml.cs


注:本文中的System.Windows.Controls.Viewbox類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。