经过前期一段时间对WPF的学习了解,相信大家对WPF有了一定的了解。今天我们一起来了解使用Component One(简称C1)的WPF控件制作CUBE浏览工具。其实这个OLAP控件官方已经有了很详细的示例。

下面是C1的WPF版所有的控件信息:

C1WPF制作OLAP Cube浏览工具

 

所有WPF控件信息:

C1WPF制作OLAP Cube浏览工具

 

OLAP组件:

C1WPF制作OLAP Cube浏览工具

 

        不管官方介绍有多好,我们还是要自己体验了控件使用才能知道到底好不好用,我们开始创建项目。

1、新建WPF项目,名称CubeAnalysis,引入C1控件

C1WPF制作OLAP Cube浏览工具

 

2、 在UI界面中先要引入C1的引用xmlns:olap="clr-namespace:C1.WPF.Olap;assembly=C1.WPF.Olap.4" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"   

3、在UI界面中调用OLAP控件

C1WPF制作OLAP Cube浏览工具

 

界面代码如下:

 1 <Window x:Class="CubeAnalysis.MainWindow"
 2 
 3         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 4 
 5         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" WindowState="Maximized"
 6 
 7         Title="MainWindow" Height="350" Width="525" xmlns:olap="clr-namespace:C1.WPF.Olap;assembly=C1.WPF.Olap.4" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml">
 8 
 9     <Grid x:Name="LayoutRoot">
10 
11         <Grid.RowDefinitions>
12 
13             <RowDefinition Height="Auto" />
14 
15             <RowDefinition />
16 
17         </Grid.RowDefinitions>
18 
19  
20 
21         <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2">
22 
23             <TextBlock Text="C1.WPF.Olap: Cube Analysis" VerticalAlignment="Center" Margin="10,5" FontSize="18" FontWeight="Bold" />
24 
25             <Button Content="更新" Margin="10,5" Width="80" Click="Button_Click" />
26 
27             <Button Content="取消更新" Margin="10,5" Width="120" Click="Button_Click_1" />
28 
29         </StackPanel>
30 
31  
32 
33         <olap:C1OlapPage x:Name="_c1OlapPage" Grid.Row="1" />
34 
35  
36 
37         <StackPanel x:Name="info" Grid.Row="1" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center">
38 
39             <c1:C1ProgressBar x:Name="progress" Width="250" Height="20" />
40 
41             <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
42 
43                 <TextBlock HorizontalAlignment="Center" Text="Loading" Margin="0,4,4,0" FontSize="12" FontWeight="Bold"/>
44 
45                 <TextBlock x:Name="txt" HorizontalAlignment="Center" Margin="0,4,0,0" FontSize="12" FontWeight="Bold"/>
46 
47             </StackPanel>
48 
49         </StackPanel>
50 
51     </Grid>
52 
53 </Window>
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
  • 2021-07-10
  • 2021-08-06
  • 2021-11-29
  • 2021-12-26
  • 2021-09-01
猜你喜欢
  • 2022-12-23
  • 2021-09-13
  • 2021-05-24
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案