本文整理汇总了C#中System.Windows.Controls.Expander类的典型用法代码示例。如果您正苦于以下问题:C# Expander类的具体用法?C# Expander怎么用?C# Expander使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Expander类属于System.Windows.Controls命名空间,在下文中一共展示了Expander类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: build_gui
private void build_gui()
{
this.DataContext = camera;
StackPanel sp_x = this.build_lbltxt(" X: ", "Eye_x");
StackPanel sp_y = this.build_lbltxt(" Y: ", "Eye_y");
StackPanel sp_z = this.build_lbltxt(" Z: ", "Eye_z");
StackPanel row1 = build_row(" Eye : ", sp_x, sp_y, sp_z);
StackPanel look_x = this.build_lbltxt(" X: ", "Lookat_x");
StackPanel look_y = this.build_lbltxt(" Y: ", "Lookat_y");
StackPanel loop_z = this.build_lbltxt(" Z: ", "Lookat_z");
StackPanel row2 = build_row(" LookAt : ", look_x, look_y, loop_z);
StackPanel sp = new StackPanel();
sp.Children.Add(row1);
sp.Children.Add(row2);
// Distance
StackPanel dist = this.build_lbltxt(" Distance: ", "Distance");
sp.Children.Add(dist);
Expander expand = new Expander();
expand.Header = "Camera";
expand.Foreground = Brushes.White;
expand.Content = sp;
this.Content = expand;
}
开发者ID:mario007,项目名称:renmas,代码行数:28,代码来源:camera_editor.xaml.cs
示例2: PopulateDepartmentGrid
/// <summary>
/// gets all departments using DepartmentService
/// and buid a Expander control with header= department name and content= department description
/// for each expander create a new row in gridDepartaments
/// </summary>
private void PopulateDepartmentGrid()
{
_deptService = new DepartmentService();
List<Department> depts = _deptService.FindAll();
int i = 0;
if (depts != null)
{
foreach (var dept in depts)
{
Expander expander = new Expander();
expander.HorizontalAlignment = HorizontalAlignment.Stretch;
expander.Header = dept.Name;
StackPanel stackPanel = new StackPanel();
TextBlock txt = new TextBlock();
txt.Text = dept.Description + ", " + dept.Floor;
stackPanel.Children.Add(txt);
expander.Content = stackPanel;
gridDepartaments.RowDefinitions.Add(new RowDefinition());
gridDepartaments.RowDefinitions[i].Height = new GridLength(50);
Grid.SetRow(expander, i);
i++;
gridDepartaments.Children.Add(expander);
}
}
}
开发者ID:AndreiOstafciuc,项目名称:MedicalClinic,代码行数:30,代码来源:PatientHomePage.xaml.cs
示例3: addHitView
public void addHitView(int jobNumber,HITView view)
{
StackPanel sp = new StackPanel();
sp.MouseUp += option1_click;
//sp.Background = Brushes.LightGray;
panels[jobNumber] = sp;
views.Add(sp, view);
jobs.Children.Add(sp);
Border border = new Border();
border.BorderThickness = new Thickness(2.0); border.Height = 1;
border.BorderBrush = Brushes.Gray;
sp.Cursor = Cursors.Hand;
jobs.Children.Add(border);
sp.Children.Add(view.stub);
view.stub.registerSidebar(this);
//sp.LayoutUpdated += child_updated;
Expander ex = new Expander();
//ex.Header = view.stub;
//ex.Content = view;
//jobs.Children.Add(ex);
}
开发者ID:tummykung,项目名称:soylent,代码行数:31,代码来源:Sidebar.xaml.cs
示例4: build_gui
private void build_gui()
{
this.DataContext = options;
StackPanel threads = this.build_lbltxt(" Threads: ", "Threads");
StackPanel spp1 = this.build_lbltxt(" SPP: ", "Spp");
StackPanel pixel_size = this.build_lbltxt(" Pixel size: ", "PixelSize");
StackPanel asm = this.build_lblcb(" Asm: ", "Asm");
StackPanel spectral = this.build_lblcb(" Spectral: ", "Spectral");
StackPanel width = this.build_lbltxt(" Width: ", "Width");
StackPanel height = this.build_lbltxt(" Height: ", "Height");
StackPanel sp = new StackPanel();
sp.Children.Add(threads);
sp.Children.Add(spp1);
sp.Children.Add(pixel_size);
sp.Children.Add(asm);
sp.Children.Add(spectral);
sp.Children.Add(width);
sp.Children.Add(height);
Expander expander = new Expander();
expander.Header = "Options";
expander.Foreground = Brushes.White;
expander.Content = sp;
this.Content = expander;
}
开发者ID:mario007,项目名称:renmas,代码行数:27,代码来源:options_editor.xaml.cs
示例5: CreateUITasklist
private Expander CreateUITasklist(TaskList list, Google.Apis.Tasks.v1.Data.Tasks tasks)
{
var expander = new Expander();
// Add a bold title.
expander.Header = list.Title;
expander.FontWeight = FontWeights.Bold;
// Add the taskItems (if applicable).
if (tasks.Items != null)
{
var container = new StackPanel();
foreach (CheckBox box in tasks.Items.Select(CreateUITask))
{
container.Children.Add(box);
}
expander.Content = container;
}
else
{
expander.Content = "There are no tasks in this list.";
}
return expander;
}
开发者ID:Cyril12740,项目名称:google-api-dotnet-client-samples,代码行数:25,代码来源:MainWindow.xaml.cs
示例6: AddReply
private void AddReply(SPTopic reply)
{
string htmlReply = reply.Body;
Debug.WriteLine(htmlReply);
// increase the default font size
htmlReply = htmlReply.Replace(";font-size:12;", ";font-size:18;");
Debug.WriteLine(htmlReply);
RichTextEditor richTextEditor = new RichTextEditor(htmlReply, false);
// TODO: set font size from user settings
Label headerLabel = new Label();
headerLabel.Content = string.Format("{0} wrote {1}", reply.Author, reply.Created);
headerLabel.FontStyle = FontStyles.Italic;
headerLabel.FontSize = 12;
Expander replyExpander = new Expander();
replyExpander.Header = headerLabel;
replyExpander.Content = richTextEditor;
replyExpander.IsExpanded = expander.IsExpanded;
if (reply.LastModified > reply.LastViewed)
{
Label label = (Label)replyExpander.Header;
label.FontWeight = FontWeights.Bold;
}
repliesListView.Children.Add(replyExpander);
}
开发者ID:rsudama,项目名称:Klabr,代码行数:30,代码来源:ReplyDialog.xaml.cs
示例7: MakeExpander
void MakeExpander()
{
//Create containing stack panel and assign to Grid row/col
StackPanel sp = new StackPanel();
Grid.SetRow(sp, 0);
Grid.SetColumn(sp, 1);
sp.Background = Brushes.LightSalmon;
//Create column title
TextBlock colTitle = new TextBlock();
colTitle.Text = "EXPANDER CREATED FROM CODE";
colTitle.HorizontalAlignment= HorizontalAlignment.Center;
colTitle.Margin.Bottom.Equals(20);
sp.Children.Add(colTitle);
//Create Expander object
Expander exp = new Expander();
//Create Bullet Panel for Expander Header
BulletDecorator bp = new BulletDecorator();
Image i = new Image();
BitmapImage bi= new BitmapImage();
bi.UriSource = new Uri(@"pack://application:,,/images/icon.jpg");
i.Source = bi;
i.Width = 10;
bp.Bullet = i;
TextBlock tb = new TextBlock();
tb.Text = "My Expander";
tb.Margin = new Thickness(20,0,0,0);
bp.Child = tb;
exp.Header = bp;
//Create TextBlock with ScrollViewer for Expander Content
StackPanel spScroll = new StackPanel();
TextBlock tbc = new TextBlock();
tbc.Text =
"Lorem ipsum dolor sit amet, consectetur adipisicing elit," +
"sed do eiusmod tempor incididunt ut labore et dolore magna" +
"aliqua. Ut enim ad minim veniam, quis nostrud exercitation" +
"ullamco laboris nisi ut aliquip ex ea commodo consequat." +
"Duis aute irure dolor in reprehenderit in voluptate velit" +
"esse cillum dolore eu fugiat nulla pariatur. Excepteur sint" +
"occaecat cupidatat non proident, sunt in culpa qui officia" +
"deserunt mollit anim id est laborum.";
tbc.TextWrapping = TextWrapping.Wrap;
spScroll.Children.Add(tbc);
ScrollViewer scr = new ScrollViewer();
scr.Content = spScroll;
scr.Height = 50;
exp.Content = scr;
exp.Width=200;
exp.HorizontalContentAlignment= HorizontalAlignment.Stretch;
//Insert Expander into the StackPanel and add it to the
//Grid
sp.Children.Add(exp);
myGrid.Children.Add(sp);
}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:59,代码来源:Window1.xaml.cs
示例8: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.DownloadParameters = ((System.Windows.Controls.Expander)(target));
return;
}
this._contentLoaded = true;
}
开发者ID:ber2dev,项目名称:manga-utilities,代码行数:9,代码来源:DownloadController.g.i.cs
示例9: SetFilter
public void SetFilter(TestCaseFilter filter)
{
RuleList.Items.Clear();
foreach (var group in filter)
{
TreeView ruleTree = new TreeView();
CheckBox selectAll = new CheckBox()
{
Content = "(Select All)",
IsChecked = group.IsSelected,
Focusable = false,
Tag = group
};
selectAll.Checked += (sender, arg) =>
{
if (group.IsSelected != true) group.IsSelected = true;
};
selectAll.Unchecked += (sender, arg) =>
{
if (group.IsSelected != false) group.IsSelected = false;
};
group.PropertyChanged += (sender, arg) =>
{
if (arg.PropertyName == "IsSelected")
{
selectAll.IsChecked = group.IsSelected;
}
};
ruleTree.Items.Add(selectAll);
AddItems(ruleTree.Items, group);
Expander expander = new Expander()
{
Header = group.Name,
Content = ruleTree,
IsExpanded = true
};
RuleList.Items.Add(expander);
ruleTree.KeyDown += (sender, arg) =>
{
if (arg.Key != Key.Space) return;
var tv = sender as TreeView;
if (tv == null) return;
ToggleTreeview(tv);
};
ruleTree.PreviewMouseWheel += ScrollViewer_PreviewMouseWheel;
ruleTree.MouseDoubleClick += (sender, arg) =>
{
if (arg.ChangedButton != MouseButton.Left) return;
var tv = sender as TreeView;
if (tv == null) return;
ToggleTreeview(tv);
};
}
}
开发者ID:gitter-badger,项目名称:WindowsProtocolTestSuites,代码行数:56,代码来源:RulePage.xaml.cs
示例10: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/gMVVM;component/Views/Common/ToolHeader.xaml", System.UriKind.Relative));
this.RootItem = ((System.Windows.Controls.UserControl)(this.FindName("RootItem")));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.ToolLog = ((System.Windows.Controls.Expander)(this.FindName("ToolLog")));
}
开发者ID:thinhlv,项目名称:PTTKHT_QLST,代码行数:10,代码来源:ToolHeader.g.cs
示例11: ShyTabs
public ShyTabs()
{
Loaded += (s, e) =>
{
_expander = this.Find<Expander>("_expander");
_vacantSpace = this.Find<Border>(name: "_vacantSpace");
_vacantSpace.MouseDown += (t, f)
=> { _expander.Toggle(); };
};
}
开发者ID:peterson1,项目名称:ErrH,代码行数:10,代码来源:ShyTabs.cs
示例12: ExpanderAutomationPeerTypeAndClass
public virtual void ExpanderAutomationPeerTypeAndClass()
{
Expander item = new Expander();
ExpanderAutomationPeer peer = null;
TestAsync(
item,
() => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as ExpanderAutomationPeer,
() => Assert.AreEqual(AutomationControlType.Group, peer.GetAutomationControlType(), "Unexpected AutomationControlType!"),
() => Assert.AreEqual("Expander", peer.GetClassName(), "Unexpected ClassType!"));
}
开发者ID:royosherove,项目名称:cthru,代码行数:10,代码来源:ExpanderAutomationPeerTest.cs
示例13: InstanceDetailsDialogExtensions
public InstanceDetailsDialogExtensions(System.Windows.Controls.UserControl dialogControl, ListBox productVersionControl, ListBox productRevisionControl, Expander moreSettinsExpander, TextBox instanceName)
{
this.DialogControl = dialogControl;
this.ParentWindow = FindParentWindow(this.DialogControl.Parent);
this.ProductVersion = productVersionControl;
this.ProductRevision = productRevisionControl;
this.MoreSettingsExpander = moreSettinsExpander;
this.InstanceName = instanceName;
}
开发者ID:Zvirja,项目名称:PrettyInstallationWindow,代码行数:10,代码来源:InstanceDetailsDialogExtensions.cs
示例14: MessageBoxEvent
static void MessageBoxEvent(Expander expander)
{
expander.Expanded += delegate
{
MessageBox.Show("");
};
expander.Collapsed += delegate
{
MessageBox.Show("");
};
}
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:11,代码来源:WPFExpanderTest.cs
示例15: ExpanderBackend
public ExpanderBackend()
{
Widget = new SWC.Expander();
Widget.Expanded += delegate {
EventSink.OnPreferredSizeChanged();
};
Widget.Collapsed += delegate {
EventSink.OnPreferredSizeChanged();
};
}
开发者ID:jbeaurain,项目名称:xwt,代码行数:11,代码来源:ExpanderBackend.cs
示例16: CreateElement
/// <summary>
/// public function that created a power element
/// </summary>
/// <param name="itemcount">used to uniquily identify the element</param>
/// <param name="powertype">used to uniquily identify the element</param>
/// <returns>created power element</returns>
public Expander CreateElement(int itemcount = 0, string powertype = "power")
{
Expander expndr = new Expander();
expndr.Name = powertype + "_" + itemcount.ToString() + "_expndr";
expndr.HorizontalAlignment = HorizontalAlignment.Stretch;
expndr.Header = CreateHeader();
expndr.Content = CreateContent();
return expndr;
}
开发者ID:skafte,项目名称:IAM,代码行数:18,代码来源:CreatePowerElement.cs
示例17: Select
private void Select(Level level)
{
RemoveUserControl();
m_userControl_level = new UserControl_Level(level);
m_expander_level = new Expander() { Header = level.Name, Content = m_userControl_level, ExpandDirection = System.Windows.Controls.ExpandDirection.Down, IsExpanded = !level.HasLayout() };
m_grid_main.SetRowColumn(m_expander_level, 1, 0);
if (level != null)
{
m_userControl_levelLayout = new UserControl_LevelEditor(level);
m_grid_main.SetRowColumn(m_userControl_levelLayout, 2, 0);
}
}
开发者ID:ianeller-romey,项目名称:CompJS_TTTD,代码行数:13,代码来源:TabItem_Level.cs
示例18: DisplayList
public void DisplayList()
{
Brush wBrush = new SolidColorBrush(Colors.White);
Brush bBrush = new SolidColorBrush(Colors.Black);
Brush gBrush = new SolidColorBrush(Colors.WhiteSmoke);
Thickness marpad = new Thickness();
marpad.Bottom = 1;
marpad.Left = 1;
marpad.Right = 1;
marpad.Top = 1;
int counter = 1;
int remainder = 0;
foreach (BaseTask x in listoftasks)
{
Expander exptemp = new Expander();
exptemp.Header = "Rank: " + x.TaskRank.ToString() + "Sev: " + x.TaskSeverity.ToString() + " Summary: " + x.Summary;
exptemp.Name = "Task" + x.TaskRank.ToString();
Math.DivRem( counter++, 2,out remainder);
if(remainder != 0)
exptemp.Background = wBrush;
else
exptemp.Background = gBrush;
exptemp.BorderBrush = bBrush;
exptemp.Margin = marpad;
exptemp.Padding = marpad;
TextBlock tb = new TextBlock();
tb.TextWrapping = TextWrapping.Wrap;
tb.Inlines.Add(new Bold(new Run("Creation Date: ")));
tb.Inlines.Add(x.Creation.ToString() + "\n");
tb.Inlines.Add(new Bold(new Run("Due Date: ")));
tb.Inlines.Add(x.DueDate.ToString() + "\n");
tb.Inlines.Add(new Bold(new Run("Status: ")));
tb.Inlines.Add(x.Status + "\n");
tb.Inlines.Add(new Bold(new Run("Reminder Types: ")));
tb.Inlines.Add("-Not Completed\n");
tb.Inlines.Add(new Bold(new Run("Description:\n")));
tb.Inlines.Add(x.Description);
exptemp.Content = tb;
ListStacker.Children.Add(exptemp);
}
}
开发者ID:krisp007,项目名称:tasklistwatcher,代码行数:51,代码来源:XTaskListWindow.xaml.cs
示例19: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/hybrid;component/MainPage.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.myMap = ((ESRI.ArcGIS.Client.Map)(this.FindName("myMap")));
this.sideBar = ((System.Windows.Controls.Border)(this.FindName("sideBar")));
this.expanderMain = ((System.Windows.Controls.Expander)(this.FindName("expanderMain")));
this.navTools = ((System.Windows.Controls.StackPanel)(this.FindName("navTools")));
this.image1 = ((System.Windows.Controls.Image)(this.FindName("image1")));
this.textBlock1 = ((System.Windows.Controls.TextBlock)(this.FindName("textBlock1")));
}
开发者ID:csergent45,项目名称:Hybrid,代码行数:14,代码来源:MainPage.g.i.cs
示例20: AddContinent
private void AddContinent(string continent, bool open, string[] countryList)
{
Expander exp = new Expander();
exp.Header = continent;
exp.IsExpanded = open;
ListBox lb = new ListBox();
lb.BorderThickness = new Thickness(0);
lb.MouseDoubleClick += new MouseButtonEventHandler(lb_MouseDoubleClick);
foreach (string country in countryList)
lb.Items.Add(country);
exp.Content = lb;
continentStackPanel.Children.Add(exp);
}
开发者ID:ngbrown,项目名称:WPFinAction,代码行数:15,代码来源:WorldListView.xaml.cs
注:本文中的System.Windows.Controls.Expander类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论