本文整理汇总了C#中System.Windows.Controls.Panel类的典型用法代码示例。如果您正苦于以下问题:C# Panel类的具体用法?C# Panel怎么用?C# Panel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Panel类属于System.Windows.Controls命名空间,在下文中一共展示了Panel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInsertPosition
private int GetInsertPosition(Panel panel)
{
if (placement == AxisPlacement.Bottom)
return panel.Children.Count;
else
return 0;
}
示例2: Loading
public void Loading(Panel parent)
{
ContentBorder.Visibility = Visibility.Collapsed;
parent.Children.Add(this);
FadeInBackground.Begin();
_wait = true;
}
示例3: FillList
public void FillList(Panel list, Action<AutoCompleteItem> selectWithClick, List<IRecyclable> recyclables)
{
foreach (var item in this.list)
{
item.CreateFrameworkElement(list, selectWithClick, recyclables, this);
}
}
示例4: ProcessorFamily
public ProcessorFamily(Panel parentPanel, int idx, string name)
{
Index = idx;
Name = name;
SelectedProcessor = null;
LabelName = new Label();
LabelName.Content = "Choose " + name;
DockPanel.SetDock(LabelName, Dock.Top);
LabelName.Height = 30.0;
LabelName.HorizontalContentAlignment = HorizontalAlignment.Center;
parentPanel.Children.Add(LabelName);
ComboProcessors = new ComboBox();
DockPanel.SetDock(ComboProcessors, Dock.Top);
ComboProcessors.Height = 25.0;
ComboProcessors.Margin = new Thickness(30.0, 5.0, 30.0, 5.0);
ComboProcessors.HorizontalContentAlignment = HorizontalAlignment.Center;
parentPanel.Children.Add(ComboProcessors);
ComboProcessors.SelectionChanged += ComboProcessors_SelectionChanged;
ParametersPanel = new ParametersSelectionPanel();
ParametersPanel.MinHeight = 20.0;
DockPanel.SetDock(ParametersPanel, Dock.Top);
parentPanel.Children.Add(ParametersPanel);
}
示例5: OnApplyTemplate
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_tabScrollViewer = GetTemplateChild("TabScrollViewerTop") as ScrollViewer;
_tabPanelTop = GetTemplateChild("HeaderPanel") as Panel;
SelectionChanged += (s, e) => scrollToSelectedItem();
}
示例6: DrawKeys
public void DrawKeys(Panel parentControl)
{
foreach (var key in _keyDictionary.Keys.Values)
{
parentControl.Children.Add(key);
}
}
示例7: AddOptions
protected override void AddOptions(Panel panel)
{
// add force low memory mode option
var lowMemoryGroup = new WrapPanel();
var cb = new CheckBox { Content = "Forced Low Memory Mode: allocate" };
BindToOption(cb, ForceLowMemoryMode.Enabled);
lowMemoryGroup.Children.Add(cb);
var textBox = new TextBox { MinWidth = 60 };
BindToOption(textBox, ForceLowMemoryMode.SizeInMegabytes);
lowMemoryGroup.Children.Add(textBox);
lowMemoryGroup.Children.Add(new TextBlock { Text = "megabytes of extra memory in devenv.exe" });
panel.Children.Add(lowMemoryGroup);
// add OOP feature options
var oopFeatureGroup = new StackPanel();
AddOption(oopFeatureGroup, NavigateToOptions.OutOfProcessAllowed, nameof(NavigateToOptions));
AddOption(oopFeatureGroup, SymbolFinderOptions.OutOfProcessAllowed, nameof(SymbolFinderOptions));
AddOption(oopFeatureGroup, SymbolSearchOptions.OutOfProcessAllowed, nameof(SymbolSearchOptions));
panel.Children.Add(oopFeatureGroup);
// and add the rest of the options
base.AddOptions(panel);
}
示例8: WPFGraphView
//! 构造普通绘图视图
public WPFGraphView(Panel container)
{
this._view = new WPFViewAdapter(this);
this.CoreView = GiCoreView.createView(this._view);
init(container);
ActiveView = this;
}
示例9: ResetChannelView
//string[] Headers = { ResetOption.Header };
//
public ResetChannelView(Panel startPanel)
{
InitializeComponent();
messages.Add(model);
ResetOption.SetResetOption(new CheckBox[] { resetChannel1, resetChannel2, resetChannel3, resetChannel4 });
StartPanel = startPanel;
}
示例10: CreateTransitionAnimation
/// <internalonly />
protected override ProceduralAnimation CreateTransitionAnimation(Panel container, EffectDirection direction)
{
if (_scaleTransform == null) {
_scaleTransform = new ScaleTransform();
container.RenderTransform = _scaleTransform;
container.RenderTransformOrigin = new Point(0.5, 0.5);
}
TweenInterpolation interpolation = GetEffectiveInterpolation();
TimeSpan shortDuration = TimeSpan.FromMilliseconds(Duration.TotalMilliseconds / 3);
FlipScaleAnimation scaleAnimation =
new FlipScaleAnimation(Duration, _scaleTransform,
(direction == EffectDirection.Forward ? 180 : -180));
scaleAnimation.Interpolation = interpolation;
DoubleAnimation frontAnimation =
new DoubleAnimation(container.Children[1], UIElement.OpacityProperty, shortDuration,
(direction == EffectDirection.Forward ? 0 : 1));
frontAnimation.Interpolation = interpolation;
frontAnimation.StartDelay = shortDuration;
DoubleAnimation backAnimation =
new DoubleAnimation(container.Children[0], UIElement.OpacityProperty, shortDuration,
(direction == EffectDirection.Forward ? 1 : 0));
backAnimation.Interpolation = interpolation;
backAnimation.StartDelay = shortDuration;
return new ProceduralAnimationSet(scaleAnimation, frontAnimation, backAnimation);
}
示例11: AddComponentInspectorsRecursively
/// <summary>
/// Adds inspectors for the components of the specified blueprint and its parents.
/// </summary>
/// <param name="viewModel">Blueprint to add component inspectors for.</param>
/// <param name="panel">Panel to add inspectors to.</param>
/// <param name="getPropertyValue">Callback to get current value for a property.</param>
/// <param name="onValueChanged">Callback to invoke when a property value changed.</param>
public void AddComponentInspectorsRecursively(
BlueprintViewModel viewModel,
Panel panel,
GetPropertyValueDelegate getPropertyValue,
InspectorControlValueChangedDelegate onValueChanged)
{
// Add inspectors for parent blueprints.
if (viewModel.Parent != null)
{
this.AddComponentInspectorsRecursively(viewModel.Parent, panel, getPropertyValue, onValueChanged);
}
// Add inspectors for specified blueprint.
foreach (var componentType in viewModel.AddedComponents)
{
// Get attributes.
InspectorType componentInfo = InspectorComponentTable.Instance.GetInspectorType(componentType);
if (componentInfo == null)
{
continue;
}
this.AddInspectorControls(componentInfo, panel, getPropertyValue, onValueChanged);
}
}
示例12: AddLabel
private void AddLabel(Panel parent, string labelString)
{
Label dname = new Label();
dname.Content = labelString;
dname.Style = (Style)FindResource("AddressStyle");
parent.Children.Add(dname);
}
示例13: RTCView
public RTCView(Panel startPanel)
{
InitializeComponent();
StartPanel = startPanel;
model = new RTCModel(txtUnitDate, txtCPUDate);
messages.Add(model);
}
示例14: WPFGraphView
//! 构造放大镜绘图视图
public WPFGraphView(WPFGraphView mainView, Panel container)
{
this.CoreView = new GiCoreView(mainView.CoreView);
this._view = new WPFViewAdapter(this);
this.CoreView.createMagnifierView(this._view, mainView.ViewAdapter);
init(container);
}
示例15: DocUITabbed
public DocUITabbed(XmlNode xmlNode, XmlSchemaAnnotated xsdNode, Panel contentpanel, Panel overlaypanel, DynamicForm parentForm)
: base(xmlNode, xsdNode, contentpanel, overlaypanel, parentForm)
{
this.Sideways = true;
_tabControl = new TabControl();
this.Control = _tabControl;
_optlist = new List<AbstractDocUIComponent>();
XmlSchemaElement schemaEl = xsdNode as XmlSchemaElement;
if (schemaEl != null)
{
XmlSchemaSequence seq = XmlSchemaUtilities.tryGetSequence(schemaEl.ElementSchemaType);
if (seq != null)
{
foreach (XmlSchemaElement el in seq.Items)
{
TabItem ti = new TabItem();
ti.Header = XmlSchemaUtilities.tryGetDocumentation(el); ;
Grid newpanel = new Grid();
ColumnDefinition cdnew1 = new ColumnDefinition();
cdnew1.Width = new GridLength(1, GridUnitType.Auto);
ColumnDefinition cdnew2 = new ColumnDefinition();
newpanel.ColumnDefinitions.Add(cdnew1);
newpanel.ColumnDefinitions.Add(cdnew2);
Utilities.recursive(el, xmlNode.SelectSingleNode(el.Name), newpanel, overlaypanel, (comp) =>
{
_optlist.Add(comp);
comp.placeOption();
}, parentForm);
ti.Content = newpanel;
this._tabControl.Items.Add(ti);
}
}
}
}