本文整理汇总了C#中System.Windows.Controls.ListView.SetResourceReference方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.SetResourceReference方法的具体用法?C# ListView.SetResourceReference怎么用?C# ListView.SetResourceReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.ListView
的用法示例。
在下文中一共展示了ListView.SetResourceReference方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createOverviewPanel
//creates the overview of the fleet
private StackPanel createOverviewPanel()
{
StackPanel panelOverview = new StackPanel();
TextBlock txtFleetBoughtHeader = new TextBlock();
txtFleetBoughtHeader.Uid = "1003";
txtFleetBoughtHeader.Margin = new Thickness(0, 0, 0, 0);
txtFleetBoughtHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
txtFleetBoughtHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
txtFleetBoughtHeader.FontWeight = FontWeights.Bold;
txtFleetBoughtHeader.Text = Translator.GetInstance().GetString("PageAirlineFleet", txtFleetBoughtHeader.Uid);
panelOverview.Children.Add(txtFleetBoughtHeader);
lvBoughtFleet = new ListView();
lvBoughtFleet.Background = Brushes.Transparent;
lvBoughtFleet.SetResourceReference(ListView.ItemContainerStyleProperty, "ListViewItemStyle");
lvBoughtFleet.MaxHeight = (GraphicsHelpers.GetContentHeight()-100) / 2;
lvBoughtFleet.AddHandler(GridViewColumnHeader.ClickEvent, new RoutedEventHandler(FleetHeaderClickedHandler), true);
lvBoughtFleet.BorderThickness = new Thickness(0);
lvBoughtFleet.View = this.Resources["FleetViewBoughtItem"] as GridView;
panelOverview.Children.Add(lvBoughtFleet);
lvBoughtFleet.ItemsSource = this.FleetDelivered.Where(f=>f.Purchased == FleetAirliner.PurchasedType.Bought || f.Purchased == FleetAirliner.PurchasedType.BoughtDownPayment);
TextBlock txtFleetLeasedHeader = new TextBlock();
txtFleetLeasedHeader.Uid = "1012";
txtFleetLeasedHeader.Margin = new Thickness(0, 5, 0, 0);
txtFleetLeasedHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
txtFleetLeasedHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
txtFleetLeasedHeader.FontWeight = FontWeights.Bold;
txtFleetLeasedHeader.Text = Translator.GetInstance().GetString("PageAirlineFleet", txtFleetLeasedHeader.Uid);
panelOverview.Children.Add(txtFleetLeasedHeader);
lvLeasedFleet = new ListView();
lvLeasedFleet.Background = Brushes.Transparent;
lvLeasedFleet.SetResourceReference(ListView.ItemContainerStyleProperty, "ListViewItemStyle");
lvLeasedFleet.MaxHeight = (GraphicsHelpers.GetContentHeight()-100) / 2;
lvLeasedFleet.AddHandler(GridViewColumnHeader.ClickEvent, new RoutedEventHandler(FleetHeaderClickedHandler), true);
lvLeasedFleet.View = this.Resources["FleetViewLeasedItem"] as GridView;
panelOverview.Children.Add(lvLeasedFleet);
lvLeasedFleet.ItemsSource = this.FleetDelivered.Where(f => f.Purchased == FleetAirliner.PurchasedType.Leased);
return panelOverview;
}
示例2: createDetailedPanel
//creates the fleet route details
private StackPanel createDetailedPanel()
{
StackPanel panelDetailed = new StackPanel();
TextBlock txtFleetHeader = new TextBlock();
txtFleetHeader.Uid = "1011";
txtFleetHeader.Margin = new Thickness(0, 0, 0, 0);
txtFleetHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
txtFleetHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
txtFleetHeader.FontWeight = FontWeights.Bold;
txtFleetHeader.Text = Translator.GetInstance().GetString("PageAirlineFleet", txtFleetHeader.Uid);
panelDetailed.Children.Add(txtFleetHeader);
lvRouteFleet = new ListView();
lvRouteFleet.Background = Brushes.Transparent;
lvRouteFleet.SetResourceReference(ListView.ItemContainerStyleProperty, "ListViewItemStyle");
lvRouteFleet.MaxHeight = 400;
lvRouteFleet.BorderThickness = new Thickness(0);
lvRouteFleet.View = this.Resources["FleetRouteViewItem"] as GridView;
panelDetailed.Children.Add(lvRouteFleet);
List<FleetAirliner> fAirliners = this.Airline.Fleet;
lvRouteFleet.ItemsSource = this.FleetDelivered;
return panelDetailed;
}