本文整理汇总了C#中Windows.UI.Xaml.Controls.Panel类的典型用法代码示例。如果您正苦于以下问题:C# Panel类的具体用法?C# Panel怎么用?C# Panel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Panel类属于Windows.UI.Xaml.Controls命名空间,在下文中一共展示了Panel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowAttachedFlyoutAtPointer
public static void ShowAttachedFlyoutAtPointer(FrameworkElement flyoutOwner, Panel rootPanel)
{
var point = PointerHelper.GetPosition();
// if no pointer, display at the flyout owner
if (point == null)
{
FlyoutBase.ShowAttachedFlyout(flyoutOwner);
return;
}
var bounds = rootPanel.TransformToVisual(Window.Current.Content).TransformPoint(new Point(0, 0));
var tempGrid = new Grid
{
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(point.Value.X - bounds.X, point.Value.Y - bounds.Y, 0, 0)
};
rootPanel.Children.Add(tempGrid);
var flyout = FlyoutBase.GetAttachedFlyout(flyoutOwner);
EventHandler<object> handler = null;
handler = (o, o1) =>
{
rootPanel.Children.Remove(tempGrid);
flyout.Closed -= handler;
};
flyout.Closed += handler;
flyout.ShowAt(tempGrid);
}
示例2: OnApplyTemplate
/// <summary>
/// Builds the visual tree for the ColorPicker control when the template is applied.
/// </summary>
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
m_rootElement = GetTemplateChild("RootElement") as Panel;
m_hueMonitor = GetTemplateChild("HueMonitor") as Rectangle;
m_sampleSelector = GetTemplateChild("SampleSelector") as Canvas;
m_hueSelector = GetTemplateChild("HueSelector") as Canvas;
m_selectedColorView = GetTemplateChild("SelectedColorView") as Rectangle;
m_colorSample = GetTemplateChild("ColorSample") as Rectangle;
m_hexValue = GetTemplateChild("HexValue") as TextBlock;
m_rootElement.RenderTransform = m_scale = new ScaleTransform();
m_hueMonitor.PointerPressed += m_hueMonitor_PointerPressed;
m_hueMonitor.PointerReleased += m_hueMonitor_PointerReleased;
m_hueMonitor.PointerMoved += m_hueMonitor_PointerMoved;
m_colorSample.PointerPressed += m_colorSample_PointerPressed;
m_colorSample.PointerReleased += m_colorSample_PointerReleased;
m_colorSample.PointerMoved += m_colorSample_PointerMoved;
m_sampleX = m_colorSample.Width;
m_sampleY = 0;
m_huePos = 0;
UpdateVisuals();
}
示例3: AttachToPage
/// <summary>
/// Attaches the layer to the root layout panel of the page.
/// </summary>
/// <param name="panel">Panel instance to attach to.</param>
internal void AttachToPage(Panel panel)
{
if (panel == null) throw new ArgumentNullException("panel");
this.SetValue(Grid.ColumnSpanProperty, 100);
this.SetValue(Grid.RowSpanProperty, 100);
panel.Children.Add(this);
}
示例4: OnApplyTemplate
protected override void OnApplyTemplate()
{
_frame = base.GetTemplateChild("frame") as Panel;
_panel = base.GetTemplateChild("panel") as CarouselPanel;
_arrows = base.GetTemplateChild("arrows") as Grid;
_left = base.GetTemplateChild("left") as Button;
_right = base.GetTemplateChild("right") as Button;
_gradient = base.GetTemplateChild("gradient") as LinearGradientBrush;
_clip = base.GetTemplateChild("clip") as RectangleGeometry;
_frame.ManipulationDelta += OnManipulationDelta;
_frame.ManipulationCompleted += OnManipulationCompleted;
_frame.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.System;
_frame.PointerMoved += OnPointerMoved;
_left.Click += OnLeftClick;
_right.Click += OnRightClick;
_left.PointerEntered += OnArrowPointerEntered;
_left.PointerExited += OnArrowPointerExited;
_right.PointerEntered += OnArrowPointerEntered;
_right.PointerExited += OnArrowPointerExited;
base.OnApplyTemplate();
}
示例5: Initialize
public static void Initialize(Panel panel)
{
InitializeOutputWindow();
IniitalizeScrollViewer();
panel.Children.Add(ScrollViewer);
IsInitialized = true;
}
示例6: MediaElementContainer
public MediaElementContainer(Panel parent)
{
parent.Children.Add(this);
mediaElement = new MediaElement() { Width = 200 };
this.Content = mediaElement;
mediaElement.Source = new Uri(parent.BaseUri, mediaUri);
this.IsTabStop = true;
AutomationProperties.SetAutomationId(mediaElement, "MediaElement1");
AutomationProperties.SetName(mediaElement, "MediaElement");
}
示例7: VisualElementPackager
public VisualElementPackager(IVisualElementRenderer renderer)
{
if (renderer == null)
throw new ArgumentNullException("renderer");
_renderer = renderer;
_panel = renderer.ContainerElement as Panel;
if (_panel == null)
throw new ArgumentException("Renderer's container element must be a Panel");
}
示例8: OnApplyTemplate
protected override void OnApplyTemplate()
{
// Apply the template
base.OnApplyTemplate();
// Find the container for our display content
contentPanel = GetTemplateChild(ContentPanelName) as Panel;
// If it's missing, major error
if (contentPanel == null) { throw new MissingTemplateElementException(ContentPanelName, nameof(GraphicsDisplayPanel)); }
}
示例9: SequencePage
public SequencePage(Panel tempPanel, String procedureName, PDU pdu, Procedure tempProcedure, StreamSocket tempSocket)
{
newSocket = tempSocket;
localProcedure = tempProcedure;
procedure = procedureName;
tempPDU = pdu;
panel2 = tempPanel;
this.InitializeComponent();
procedureTextBlock.Text = procedureName;
loadSequences();
}
示例10: MonitorControl
public void MonitorControl(Panel panel)
{
Monitor = new Rectangle {Fill = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0))};
Monitor.SetValue(Grid.RowSpanProperty, int.MaxValue - 1);
Monitor.SetValue(Grid.ColumnSpanProperty, int.MaxValue - 1);
Monitor.ManipulationMode = ManipulationModes.All;
Monitor.ManipulationStarted += MonitorManipulationStarted;
Monitor.ManipulationDelta += MonitorManipulationDelta;
panel.Children.Add(Monitor);
}
示例11: AddWebViewWithBinding
public static void AddWebViewWithBinding(Panel parent, object source, string path)
{
RemoveParent();
_webViewInstance.SetBinding(WebViewExtend.ContentProperty, new Binding() { Source = source, Path = new PropertyPath(path) });
lock(_parentLocker)
{
parent.Children.Add(_webViewInstance);
if (!_webViewParents.Contains(parent))
{
_webViewParents.Add(parent);
}
}
}
示例12: OnApplyTemplate
/// <summary>${controls_SliderElement_method_onApplyTemplate_D}</summary>
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
this.trackPanel = base.GetTemplateChild("TrackPanel") as Panel;
this.thumb = base.GetTemplateChild("ThumbElement") as Thumb;
if (this.thumb != null)
{
this.thumb.DragStarted += new DragStartedEventHandler(this.OnThumbDragStarted);
this.thumb.DragDelta += new DragDeltaEventHandler(this.OnThumbDragDelta);
this.thumb.DragCompleted += new DragCompletedEventHandler(this.OnThumbDragCompleted);
}
this.bufferElement = base.GetTemplateChild("Buffer") as Rectangle;
this.UpdateTrackMarks();
}
示例13: AttachedProgress
public AttachedProgress(Panel parentElement, double width, double height)
{
ParentElement = parentElement;
isActive = false;
popup = new Popup();
progressRing = new ProgressRing();
progressRing.IsActive = false;
progressRing.VerticalAlignment = VerticalAlignment.Stretch;
progressRing.HorizontalAlignment = HorizontalAlignment.Stretch;
Width = width;
Height = height;
popup.Child = progressRing;
parentElement.Children.Add(popup);
}
示例14: OnApplyTemplate
protected override void OnApplyTemplate()
{
_splitView = base.GetTemplateChild("splitView") as SplitView;
_toggle = base.GetTemplateChild("toggle") as Button;
_exitFS = base.GetTemplateChild("exitFS") as Button;
_headerContainer = base.GetTemplateChild("headerContainer") as Panel;
_commandBarContainer = base.GetTemplateChild("commandBarContainer") as ContentControl;
_paneHeaderContainer = base.GetTemplateChild("paneHeaderContainer") as ContentControl;
_lview = base.GetTemplateChild("lview") as ListView;
_lviewSub = base.GetTemplateChild("lviewSub") as ListView;
_container = base.GetTemplateChild("container") as Panel;
_content = base.GetTemplateChild("content") as Panel;
_topPane = base.GetTemplateChild("topPane") as ContentControl;
_rightPane = base.GetTemplateChild("rightPane") as ContentControl;
if (ListViewItemContainerStyle != null)
{
_lview.ItemContainerStyleSelector = new NavigationStyleSelector(ListViewItemContainerStyle, this.SeparatorStyle);
_lviewSub.ItemContainerStyleSelector = new NavigationStyleSelector(ListViewItemContainerStyle, this.SeparatorStyle);
}
else
{
_lview.ItemContainerStyleSelector = new NavigationStyleSelector(_lview.ItemContainerStyle, this.SeparatorStyle);
_lviewSub.ItemContainerStyleSelector = new NavigationStyleSelector(_lview.ItemContainerStyle, this.SeparatorStyle);
}
_lview.ItemContainerStyle = null;
_lviewSub.ItemContainerStyle = null;
_toggle.Click += OnToggleClick;
_exitFS.Click += OnExitFSClick;
_splitView.PaneClosed += OnPaneClosed;
_lview.ItemClick += OnItemClick;
_lviewSub.ItemClick += OnItemClick;
_lview.SelectionChanged += OnSelectionChanged;
_isInitialized = true;
this.SelectFirstNavigationItem();
SetDisplayMode(this.DisplayMode);
SetCommandBar(_commandBar);
SetCommandBarVerticalAlignment(this.CommandBarVerticalAlignment);
SetPaneHeader(_paneHeader);
base.OnApplyTemplate();
}
示例15: OnApplyTemplate
protected override void OnApplyTemplate()
{
_frame = base.GetTemplateChild("frame") as Panel;
_headerContainer = base.GetTemplateChild("headerContainer") as Panel;
_header = base.GetTemplateChild("header") as PivoramaPanel;
_header.SelectedIndexChanged += OnSelectedIndexChanged;
_tabsContainer = base.GetTemplateChild("tabsContainer") as Panel;
_tabs = base.GetTemplateChild("tabs") as PivoramaTabs;
_tabs.SelectedIndexChanged += OnSelectedIndexChanged;
_panelContainer = base.GetTemplateChild("panelContainer") as Panel;
_panel = base.GetTemplateChild("panel") as PivoramaPanel;
_arrows = base.GetTemplateChild("arrows") as Grid;
_left = base.GetTemplateChild("left") as Button;
_right = base.GetTemplateChild("right") as Button;
_clip = base.GetTemplateChild("clip") as RectangleGeometry;
_frame.ManipulationDelta += OnManipulationDelta;
_frame.ManipulationCompleted += OnManipulationCompleted;
_frame.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateInertia | ManipulationModes.System;
_frame.PointerWheelChanged += OnPointerWheelChanged;
_panelContainer.ManipulationDelta += OnManipulationDelta;
_panelContainer.ManipulationCompleted += OnManipulationCompleted;
_panelContainer.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateInertia | ManipulationModes.System;
_frame.PointerMoved += OnPointerMoved;
_left.Click += OnLeftClick;
_right.Click += OnRightClick;
_left.PointerEntered += OnArrowPointerEntered;
_left.PointerExited += OnArrowPointerExited;
_right.PointerEntered += OnArrowPointerEntered;
_right.PointerExited += OnArrowPointerExited;
_isInitialized = true;
this.ItemWidthEx = this.ItemWidth;
this.SizeChanged += OnSizeChanged;
base.OnApplyTemplate();
}