⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 app.xaml

📁 wpf和cab的结合使用源码(转载)
💻 XAML
字号:
<Application x:Class="BankShell.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:cab="clr-namespace:Microsoft.Practices.CompositeUI.Windows.Workspaces;assembly=Microsoft.Practices.CompositeUI.Windows"
    >
	<!-- note the absence of a StartupUri above - the CAB application will open our root window -->

	<!-- here are some styles, mainly just to make it obvious we're running under WPF (animations and what-have-you) -->
	<Application.Resources>
		<Style TargetType="{x:Type Button}">
			<Setter Property="Margin" Value="3"/>
			<Setter Property="MinWidth" Value="75"/>
			<Setter Property="Background" Value="White"/>

			<Style.Triggers>
				<EventTrigger RoutedEvent="MouseEnter">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<ColorAnimation To="#80c2ce" Duration="0:0:.5" Storyboard.TargetProperty="Background.Color"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>
				<EventTrigger RoutedEvent="MouseLeave">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<ColorAnimation To="White" Duration="0:0:.5" Storyboard.TargetProperty="Background.Color"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>
			</Style.Triggers>
		</Style>
		<Style TargetType="{x:Type TextBox}">
			<Setter Property="Margin" Value="3"/>
			<Setter Property="Background" Value="White"/>
			
			<Style.Triggers>
				<EventTrigger RoutedEvent="MouseEnter">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<ColorAnimation To="#80c2ce" Duration="0:0:.5" Storyboard.TargetProperty="Background.Color"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>
				<EventTrigger RoutedEvent="MouseLeave">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<ColorAnimation To="White" Duration="0:0:.5" Storyboard.TargetProperty="Background.Color"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>
			</Style.Triggers>
		</Style>
		<Style TargetType="{x:Type ListBox}">
			<Setter Property="Margin" Value="3"/>
		</Style>
		<Style TargetType="{x:Type ListBoxItem}">
			<Setter Property="Background" Value="White"/>

			<Style.Triggers>
				<EventTrigger RoutedEvent="MouseEnter">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<ColorAnimation To="#80c2ce" Duration="0:0:.5" Storyboard.TargetProperty="Background.Color"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>
				<EventTrigger RoutedEvent="MouseLeave">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<ColorAnimation To="White" Duration="0:0:.5" Storyboard.TargetProperty="Background.Color"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>
			</Style.Triggers>
		</Style>
		<Style TargetType="{x:Type ListViewItem}">
			<Setter Property="Background" Value="White"/>

			<Style.Triggers>
				<EventTrigger RoutedEvent="MouseEnter">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<ColorAnimation To="#80c2ce" Duration="0:0:.5" Storyboard.TargetProperty="Background.Color"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>
				<EventTrigger RoutedEvent="MouseLeave">
					<EventTrigger.Actions>
						<BeginStoryboard>
							<Storyboard>
								<ColorAnimation To="White" Duration="0:0:.5" Storyboard.TargetProperty="Background.Color"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger.Actions>
				</EventTrigger>
			</Style.Triggers>
		</Style>
		<Style TargetType="{x:Type Label}">
			<Setter Property="Margin" Value="3"/>
		</Style>
		<Style TargetType="{x:Type Label}" BasedOn="{StaticResource {x:Type Label}}" x:Key="Title">
			<Setter Property="FontWeight" Value="ExtraBold"/>
			<Setter Property="FontSize" Value="14"/>
			<Setter Property="Background" Value="#30626e"/>
			<Setter Property="Foreground" Value="White"/>
		</Style>
		<Style TargetType="{x:Type cab:TabWorkspace}">
			<Setter Property="Margin" Value="3"/>
		</Style>
	</Application.Resources>
</Application>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -