• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.ContentPresenter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Controls.ContentPresenter的典型用法代码示例。如果您正苦于以下问题:C# ContentPresenter类的具体用法?C# ContentPresenter怎么用?C# ContentPresenter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ContentPresenter类属于System.Windows.Controls命名空间,在下文中一共展示了ContentPresenter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: WatermarkAdorner

        /// <summary>
        /// Initializes a new instance of the <see cref="WatermarkAdorner"/> class
        /// </summary>
        /// <param name="adornedElement"><see cref="UIElement"/> to be adorned</param>
        /// <param name="watermark">The watermark</param>
        public WatermarkAdorner(UIElement adornedElement, object watermark)
            : base(adornedElement)
        {
            IsHitTestVisible = false;

            contentPresenter = new ContentPresenter
            {
                Content = watermark,
                Opacity = 0.5,
                Margin = new Thickness(Control.Margin.Left + Control.Padding.Left, Control.Margin.Top + Control.Padding.Top, 0, 0)
            };

            if (Control is ItemsControl && !(Control is ComboBox))
            {
                contentPresenter.VerticalAlignment = VerticalAlignment.Center;
                contentPresenter.HorizontalAlignment = HorizontalAlignment.Center;
            }

            // Hide the control adorner when the adorned element is hidden
            var binding = new Binding("IsVisible")
            {
                Source = adornedElement,
                Converter = new BooleanToVisibilityConverter()
            };
            SetBinding(VisibilityProperty, binding);
        }
开发者ID:Slesa,项目名称:Poseidon,代码行数:31,代码来源:WatermarkAdorner.cs


示例2: OnApplyTemplate

 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     _presenter = this.GetTemplateChild("ContentContainer") as ContentPresenter;
     SetupZoomRight();
     SetupGestureListener(this.GetTemplateChild("ContentBorder"));
 }
开发者ID:halllo,项目名称:SilverlightRun,代码行数:7,代码来源:ColdZoomContainer.cs


示例3: MakeCommand

 public ICommand MakeCommand(ContentPresenter contentPresenter)
 {
     return new RepairCompanyListCommand
                {
                    ContentPre = contentPresenter
                };
 }
开发者ID:shuvo009,项目名称:RahamtGroupStore,代码行数:7,代码来源:RepairCompanyListCommand.cs


示例4: DropPreviewAdorner

 /// <summary>
 /// Initializes a new instance of the <see cref="DropPreviewAdorner"/> class.
 /// </summary>
 /// <param name="feedbackUI">The UI element used as feedback element.</param>
 /// <param name="adornedElement">The element to bind the adorner to.</param>
 public DropPreviewAdorner(UIElement feedbackUI, UIElement adornedElement)
     : base(adornedElement)
 {
     m_Presenter = new ContentPresenter();
     m_Presenter.Content = feedbackUI;
     m_Presenter.IsHitTestVisible = false;
 }
开发者ID:pvandervelde,项目名称:Apollo,代码行数:12,代码来源:DropPreviewAdorner.cs


示例5: MakeCommand

 public ICommand MakeCommand(ContentPresenter contentPresenter)
 {
     return new ViewStockRegisterCommand
     {
         ContentPre = contentPresenter
     };
 }
开发者ID:njmube,项目名称:PointOfSales,代码行数:7,代码来源:ViewStockRegisterCommand.cs


示例6: MakeCommand

 public ICommand MakeCommand(ContentPresenter contentPresenter)
 {
     return new CompanyCommand
         {
             ContentPre = contentPresenter
         };
 }
开发者ID:njmube,项目名称:PointOfSales,代码行数:7,代码来源:CompanyCommand.cs


示例7: MakeCommand

 public ICommand MakeCommand(ContentPresenter contentPresenter)
 {
     return new DoBankDepositCommand
         {
             ContentPre = contentPresenter
         };
 }
开发者ID:njmube,项目名称:PointOfSales,代码行数:7,代码来源:DoBankDepositCommand.cs


示例8: DataTemplateAdorner

		public DataTemplateAdorner(object data, UIElement adornedElement, DataTemplate dataTemplate)
			: base(adornedElement) {
			_contentPresenter = new ContentPresenter() {
				Content = data,
				ContentTemplate = dataTemplate,
			};
		}
开发者ID:RushuiGuan,项目名称:mvvm,代码行数:7,代码来源:DataTemplateAdorner.cs


示例9: UpdateCells

        private void UpdateCells()
        {
            var grid = this.Content as UniformGrid;
            int counter = 0;
            foreach (Border child in grid.Children)
            {
                try
                {
                    var cp = new ContentPresenter();
                    cp.MouseLeftButtonDown += (sender, args) =>
                    {
                        UIElement el = (UIElement) sender;
                        var _point = args.MouseDevice.GetPosition(el);
                        el.CaptureMouse();
                    };
                    cp.Content = board[counter++];
                    child.Child = cp;

                    //child.Child = new TextBlock()
                    //{
                    //    Text = board[counter++].GetType().ToString()
                    //};
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                    return;
                }

            }
        }
开发者ID:Namolem,项目名称:checkers,代码行数:31,代码来源:ChessBoard.xaml.cs


示例10: ParseCommand

 internal  ICommand ParseCommand(string requestedCommand, ContentPresenter contentPresenter)
 {
     var command = FindRequestedCommand(requestedCommand);
     if(command ==null)
         return new NotFoundCommand{Name = requestedCommand};
     return command.MakeCommand(contentPresenter);
 }
开发者ID:shuvo009,项目名称:RahamtGroupStore,代码行数:7,代码来源:CommandParser.cs


示例11: ResizeThumb_DragStarted

        private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = this.DataContext as ContentControl;

            if (this.designerItem != null)
            {
                this.canvas = VisualTreeHelper.GetParent(this.designerItem) as ContentPresenter;

                if (this.canvas != null)
                {
                    this.transformOrigin = this.designerItem.RenderTransformOrigin;

                    this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
                    if (this.rotateTransform != null)
                    {
                        this.angle = this.rotateTransform.Angle * Math.PI / 180.0;
                    }
                    else
                    {
                        this.angle = 0.0d;
                    }

                    AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.canvas);
                    if (adornerLayer != null)
                    {
                        this.adorner = new SizeAdorner(this.designerItem);
                        adornerLayer.Add(this.adorner);
                    }
                }
            }
        }
开发者ID:nakioman,项目名称:furryrun-editor,代码行数:31,代码来源:ResizeThumb.cs


示例12: MakeCommand

 public ICommand MakeCommand(ContentPresenter contentPresenter)
 {
     return new ViewSupplierBalanceCommand
         {
             ContentPre = contentPresenter
         };
 }
开发者ID:njmube,项目名称:PointOfSales,代码行数:7,代码来源:ViewSupplierBalanceCommand.cs


示例13: PopupButton

		public PopupButton()
		{
			var content = new ContentPresenter();
			content.SetBinding(ContentPresenter.ContentProperty, new Binding("PopupContent") { Source = this });
			var border = new Border()
			{
				CornerRadius = new CornerRadius(5),
				BorderThickness = new Thickness(1),
				Child = content
			};
			border.SetResourceReference(Border.BackgroundProperty, "BaseWindowBackgroundBrush");
			border.SetResourceReference(Border.BorderBrushProperty, "WindowBorderBrush");
			_popup = new Popup()
			{
				AllowsTransparency = true,
				StaysOpen = false,
				Placement = PlacementMode.Bottom,
				PlacementTarget = this,
				DataContext = this,
				Child = border,
			};
			_popup.SetBinding(Popup.IsOpenProperty, "IsChecked");
			_popup.SetBinding(Popup.WidthProperty, "Width");
			SetBinding(PopupButton.IsHitTestVisibleProperty, new Binding("IsOpen") { Source = _popup, Mode = BindingMode.OneWay, Converter = new InverseBooleanConverter() });
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:25,代码来源:PopupButton.cs


示例14: MakeCommand

 public ICommand MakeCommand(ContentPresenter contentPresenter)
 {
     return new ViewCustomerLedgerCommand
         {
             ContentPre = contentPresenter
         };
 }
开发者ID:njmube,项目名称:PointOfSales,代码行数:7,代码来源:ViewCustomerLedgerCommand.cs


示例15: MakeCommand

 public ICommand MakeCommand(ContentPresenter contentPresenter)
 {
     return new DoBankWithdrawalCommand
         {
             ContentPre = contentPresenter
         };
 }
开发者ID:njmube,项目名称:PointOfSales,代码行数:7,代码来源:DoBankWithdrawalCommand.cs


示例16: TeamSettingsControl

 public TeamSettingsControl(ContentPresenter disabler, TeamManagement teamManagement)
 {
     _teamManagement = teamManagement;
     InitializeComponent();
     InitGwupeDataCaptureForm(disabler, StatusText, ErrorText);
     ProcessingWord = "Updating";
 }
开发者ID:gwupe,项目名称:Gwupe,代码行数:7,代码来源:TeamSettingsControl.xaml.cs


示例17: RotateThumb_DragStarted

        private void RotateThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = DataContext as ContentControl;

            if (this.designerItem != null)
            {
                this.canvas = VisualTreeHelper.GetParent(this.designerItem) as ContentPresenter;

                if (this.canvas != null)
                {
                    this.centerPoint = this.designerItem.TranslatePoint(
                        new Point(this.designerItem.Width * this.designerItem.RenderTransformOrigin.X,
                                  this.designerItem.Height * this.designerItem.RenderTransformOrigin.Y),
                                  this.canvas);

                    Point startPoint = Mouse.GetPosition(this.canvas);
                    this.startVector = Point.Subtract(startPoint, this.centerPoint);

                    this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
                    if (this.rotateTransform == null)
                    {
                        this.designerItem.RenderTransform = new RotateTransform(0);
                        this.initialAngle = 0;
                    }
                    else
                    {
                        this.initialAngle = this.rotateTransform.Angle;
                    }
                }
            }
        }
开发者ID:nakioman,项目名称:furryrun-editor,代码行数:31,代码来源:RotateThumb.cs


示例18: OnApplyTemplate

 //重写OnApplyTemplate()方法获取模板样式的子控件
 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     this.body = this.GetTemplateChild("body") as ContentPresenter;
     this.backgroundRect = this.GetTemplateChild("backgroundRect") as System.Windows.Shapes.Rectangle;
     InitializeMessagePrompt();
 }
开发者ID:ChunguangZha,项目名称:HouseKeeper_WP8,代码行数:8,代码来源:MyMessage.cs


示例19: MakeCommand

 public ICommand MakeCommand(ContentPresenter contentPresenter)
 {
     return new ViewInitialBalanceCommand
     {
         ContentPre = contentPresenter
     };
 }
开发者ID:njmube,项目名称:PointOfSales,代码行数:7,代码来源:ViewInitialBalanceCommand.cs


示例20: WebProjectSelectionNode

        public WebProjectSelectionNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            DataContext = this;

            AddOutputPortToNode("Project", typeof(object));
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            IsResizeable = true;

            var webControl = new WebProjectSelection(_controller.IntBase);
            {
                Visibility = Visibility.Visible;
            };

            // webControl.ProjectChangedEventHandler += ProjectSelectionViewModelOnProjectChangedEventHandler;
            // webControl.TeamChangedEventHandler += ProjectSelectionViewModelOnTeamChangedEventHandler;

            var pr = new ContentPresenter
            {
                Content = webControl,
                MinWidth = 600,
                MinHeight = 600
            };

            AddControlToNode(pr);
        }
开发者ID:Dessix,项目名称:TUM.CMS.VPLControl,代码行数:28,代码来源:WebProjectSelectionNode.cs



注:本文中的System.Windows.Controls.ContentPresenter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Controls.ContextMenu类代码示例发布时间:2022-05-26
下一篇:
C# Controls.ContentControl类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap