silverlight怎么写导航栏
1个回答
2015-03-21
展开全部
在制作该项目时必须添加相应的命名空间。
在该制作中需要添加的命名空间是 xmlns:controls="clr-namespace:NetMultiGisApp.Controls;assembly=NetMultiGisApp"该命名控件是公司牛人自定义封装的。
我在这里将前台的代码贴出,供大家指正.......相应的属性我已经在代码中贴出....
<Grid x:Name="LayoutRoot" Background="Black">
<Grid.Resources>
<Style x:Key="ccc" TargetType="controls:HyperLinkControl">
<Setter Property="NavigateUri" Value="www.baidu.com"/>
<Setter Property="FontSize" Value="11"/>
<!--?-->
<Setter Property="Foreground" Value="Gray"/>
<!--Cursor鼠标悬停时显示__Value?-->
<Setter Property="Cursor" Value="SizeNESW"/>
<Setter Property="Margin" Value="0,3,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:HyperLinkControl">
<HyperlinkButton x:Name="Part_linkbutton" Content="{TemplateBinding Content}">
<HyperlinkButton.Style>
<Style TargetType="HyperlinkButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="HyperlinkButton">
<Grid x:Name="grid" Background="Transparent">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<!--GeneratedDuration颜色变化的时间间隔-->
<VisualTransition GeneratedDuration="0:0:1"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<!--颜色变化 To为变化后的颜色-->
<ColorAnimation Duration="0" To="Red" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentControl x:Name="content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Foreground="White"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</HyperlinkButton.Style>
</HyperlinkButton>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.Top="0">
<TextBlock Text="网络多维分析系统应用专区"
FontFamily="Trebuchet MS"
Foreground="#FFA8D300" Height="16"
Margin="1,0,0,0" VerticalAlignment="Center"></TextBlock>
<!--IsPopup? RenderTransformOrigin?-->
<controls:HyperLinkControl NavigateUri="www.baidu.com" Margin="5,3,5,0" Style="{StaticResource ccc}" IsPopup="True" Height="22" x:Name="h1">
<!--Opacity对象的不透明度__0为完全透明-->
<TextBlock x:Name="AJAX_Demos1" Text="系统分析" Opacity="10" RenderTransformOrigin="10,0.5">
<TextBlock.RenderTransform>
<!--TranslateY TranslateX指的是TextBlock的位置 RenderTransform设置或获取元素呈现变换的原点-->
<CompositeTransform TranslateY="0"/>
</TextBlock.RenderTransform>
</TextBlock>
</controls:HyperLinkControl>
<!--BorderThickness设置边框的粗细-->
<Border Height="20" VerticalAlignment="Center" Width="1" BorderThickness="1" x:Name="b1">
<Border.BorderBrush>
<!--LinearGradientBrush设置线性渐变EndPoint StartPoint分别为终止和起始坐标-->
<LinearGradientBrush EndPoint="1,1" StartPoint="1,0" x:Name="l1">
<!--GradientStop渐变停止点-->
<GradientStop Color="White" Offset="1"></GradientStop>
<GradientStop Color="Red" Offset="0.198"></GradientStop>
</LinearGradientBrush>
</Border.BorderBrush>
</Border>
<controls:HyperLinkControl NavigateUri="www.baidu.com" Margin="5,3,5,0" Style="{StaticResource ccc}" IsPopup="True" Height="22">
<TextBlock x:Name="AJAX_Demos2" Text="网络规划" Opacity="100" RenderTransformOrigin="0.5,0.5">
<TextBlock.RenderTransform>
<CompositeTransform TranslateY="0"/>
</TextBlock.RenderTransform>
</TextBlock>
</controls:HyperLinkControl>
<Border Height="20" VerticalAlignment="Bottom" Width="1" BorderThickness="1">
<Border.BorderBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#66FFFFFF" Offset="1"></GradientStop>
<GradientStop Color="Transparent" Offset="0.198"></GradientStop>
</LinearGradientBrush>
</Border.BorderBrush>
</Border>
</StackPanel>
</Grid>
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询