当前位置: 首页>>代码示例>>C#>>正文


C# ListView.SetResourceReference方法代码示例

本文整理汇总了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;
        }
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:50,代码来源:PageAirlineFleet.xaml.cs

示例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;
        }
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:30,代码来源:PageAirlineFleet.xaml.cs


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