求助,WPF中如何对导航栏的背景色进行改变

DongJing-Yin 2018-05-23 04:39:26
现环境如下:
使用Gird网格布局了自己的顶部导航菜单,但是我发现WPF不能够通过Row或Column的编号来反向控制对应区域,使用Border会覆盖掉icon,颜色变了,但是icon也没了,我是在用户控件里 进行编写的。

<Image Grid.Column="1" Source="resource/icon_home.png" Width="35" Height="35" VerticalAlignment="Bottom"/>
<Label Grid.Row="1" Grid.Column="1" Content="主 页" Foreground="#fff" FontSize="14" HorizontalAlignment="Center"/>

<Image Grid.Column="2" Source="resource/icon_equipment.png" Width="35" Height="35" VerticalAlignment="Bottom"/>
<Label Grid.Row="1" Grid.Column="2" Content="设 备" Foreground="#fff" FontSize="14" HorizontalAlignment="Center"/>

<Image Grid.Column="3" Source="/resource/icon_group.png" Height="35" Width="35" VerticalAlignment="Bottom" />
<Label Grid.Row="1" Grid.Column="3" Content="班 组" Foreground="#fff" FontSize="14" HorizontalAlignment="Center"/>

<Image Grid.Column="4" Height="35" VerticalAlignment="Bottom" Width="35" Source="/resource/icon_report.png" />
<Label Grid.Row="1" Grid.Column="4" Content="日 志" Foreground="#fff" FontSize="14" HorizontalAlignment="Center" />


求助大佬,这个需求应该如何解决。
...全文
1389 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_36524291 2018-07-10
  • 打赏
  • 举报
回复
不是很懂,如果你需要改变导航栏!AllowsTransparency="True" WindowStyle="None"
Background="{x:Null}" MouseLeftButtonDown="Window_MouseLeftButtonDown"
然后我推荐是直接给图上去一个背景图然后你再用grid进行布局 而且没必要使用
fly___fly 2018-06-14
  • 打赏
  • 举报
回复
要做什么呢?修改Background? 如果是要修改 Grid 的,直接设置Grid的Background属性不行吗?
exception92 2018-05-24
  • 打赏
  • 举报
回复
反向控制对应区域, -》解释你的“反向控制” 使用Border会覆盖掉icon,颜色变了,但是icon也没了 -》设置panel.Zindex的值来控制层级呢

17,740

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧