PageRenderTime 19ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/V4/Quickstarts/Modularity/Desktop/ModularityWithUnity/ModularityWithUnity.Desktop/ModuleControl.xaml

#
XAML | 75 lines | 67 code | 4 blank | 4 comment | 0 complexity | 19ef51145bc815e8f87394ce357ac4b6 MD5 | raw file
 1<UserControl x:Class="ModularityWithUnity.Desktop.ModuleControl"
 2    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 3	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 4	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 5	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"         
 6	mc:Ignorable="d"		
 7	UseLayoutRounding="True"
 8	d:DesignWidth="100" d:DesignHeight="100"
 9    Loaded="ModuleControl_Loaded"    >
10    <!-- This control binds against ModuleTrackingState -->
11    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
12        <Border HorizontalAlignment="Center" VerticalAlignment="Center">
13            <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
14                <Grid.RowDefinitions>
15                    <RowDefinition Height="Auto"/>
16                    <RowDefinition Height="Auto"/>
17                    <RowDefinition Height="Auto"/>
18                </Grid.RowDefinitions>
19                <TextBlock TextWrapping="Wrap" 
20                           Text="{Binding ModuleName, FallbackValue=Unknown}" 
21                           TextAlignment="Center" 
22                           HorizontalAlignment="Center" VerticalAlignment="Center"/>
23                <!-- This will show up if module is loadable on demand -->
24                <TextBlock x:Name="ClickToLoadTextBlock" 
25                           TextWrapping="Wrap" TextAlignment="Center"
26                           HorizontalAlignment="Center" VerticalAlignment="Center" 
27                           Text="(Click to load)" Grid.Row="1" Foreground="#FFDE8310" Visibility="Collapsed" FontSize="9.667"/>
28                <!-- This will show up while the module is loading -->
29                <Grid Grid.Row="2" x:Name="LoadProgressPanel" >
30                    <Grid.RowDefinitions>
31                        <RowDefinition Height="Auto"/>
32                        <RowDefinition Height="Auto"/>
33                    </Grid.RowDefinitions>
34                    <ProgressBar Value="{Binding DownloadProgressPercentage, Mode=OneWay}" Maximum="100" Margin="2" Height="10" />
35                    <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
36                        <TextBlock TextWrapping="Wrap"                    
37                           Text="{Binding DownloadProgressPercentage, Mode=OneWay}"
38                            FontSize="9.667"/>
39                        <TextBlock Text="%" FontSize="9.667"/>
40                    </StackPanel>
41                </Grid>
42            </Grid>
43        </Border>
44    </Grid>
45    <!-- This tooltip helps users see additional information about the module -->
46    <ToolTipService.ToolTip >
47        <Grid>
48            <Grid.RowDefinitions>
49                <RowDefinition Height="Auto"/>
50                <RowDefinition Height="Auto"/>
51                <RowDefinition Height="Auto"/>
52                <RowDefinition Height="Auto"/>
53                <RowDefinition Height="Auto"/>
54            </Grid.RowDefinitions>
55            <Grid.ColumnDefinitions>
56                <ColumnDefinition Width="100"></ColumnDefinition>
57                <ColumnDefinition Width="200"></ColumnDefinition>
58            </Grid.ColumnDefinitions>
59            <TextBlock Grid.Column="0" Grid.Row="0" Text="Status: " />
60            <TextBlock Grid.Column="1" Grid.Row="0" TextWrapping="Wrap" Text="{Binding ModuleInitializationStatus, FallbackValue=Unknown}" />
61
62            <TextBlock Grid.Column="0" Grid.Row="1" Text="Discovery: " />
63            <TextBlock Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Text="{Binding ExpectedDiscoveryMethod, FallbackValue=Unknown}" />
64
65            <TextBlock Grid.Column="0" Grid.Row="2" Text="Initialized: " />
66            <TextBlock Grid.Column="1" Grid.Row="2" TextWrapping="Wrap" Text="{Binding ExpectedInitializationMode, FallbackValue=Unknown}" />
67
68            <TextBlock Grid.Column="0" Grid.Row="3" Text="Downloaded: " />
69            <TextBlock Grid.Column="1" Grid.Row="3" TextWrapping="Wrap" Text="{Binding ExpectedDownloadTiming, FallbackValue=Unknown}" />
70
71            <TextBlock Grid.Column="0" Grid.Row="4" Text="Depends On: " />
72            <TextBlock Grid.Column="1" Grid.Row="4" TextWrapping="Wrap" Text="{Binding ConfiguredDependencies, FallbackValue=Unknown}" />
73        </Grid>
74    </ToolTipService.ToolTip>
75</UserControl>