- 浏览: 400828 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (309)
- xaml C# wpf (0)
- scala java inner clas (1)
- Tools UML Eclipse UML2 (1)
- Timer .NET Framework (1)
- perl (6)
- python function paramter (1)
- Python Docstring (1)
- Python how to compare types (1)
- Python (8)
- java (5)
- C# (76)
- C# WPF (0)
- p4 (0)
- WPF (46)
- .net (6)
- xaml (1)
- javascript (40)
- windows (10)
- scala (4)
- winform (1)
- c++ (48)
- tools (12)
- cmd (1)
- os (0)
- CI (0)
- shell (0)
- C (2)
- haskell (49)
- functional (1)
- tool (1)
- gnu (1)
- linux (1)
- kaskell (0)
- svn (0)
- wcf (3)
- android (1)
最新评论
The System.WIndows.Controls.Grid classes does provide a ShowGridLines method, while it does not provide means to override the style of the grid lines.
Ian Oakes has shows some good ways to use the grid lines and his post is available at "Displaying Grid Lines"
While it does show the quitessence of programming with styles, so here is what is the most important of the styles.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style x:Key="lineStyle" TargetType="Line"> <Setter Property="Stroke" Value="Gray" /> <Setter Property="Stretch" Value="Fill" /> <Setter Property="Grid.ZIndex" Value="100" /> <Setter Property="StrokeDashArray" Value="1,2" /> <!-- DoubleValueCollection--> </Style> <Style x:Key="horizontalLineStyle" TargetType="Line" BasedOn="{StaticResource lineStyle}" > <Setter Property="X2" Value="1" /> <Setter Property="VerticalAlignment" Value="Bottom" /> <Setter Property="Grid.ColumnSpan" Value="{Binding Path=ColumnDefinitions.Count, RelativeSource={RelativeSource AncestorType=Grid}}" /> </Style> <Style x:Key="verticalLineStyle" TargetType="Line" BasedOn="{StaticResource lineStyle}" > <Setter Property="Y2" Value="1" /> <Setter Property="HorizontalAlignment" Value="Right" /> <Setter Property="Grid.RowSpan" Value="{Binding Path=RowDefinitions.Count, RelativeSource={RelativeSource AncestorType=Grid}}" /> </Style> <Style x:Key="verticalLineStyleLeft" TargetType="Line" BasedOn="{StaticResource verticalLineStyle}" > <Setter Property="HorizontalAlignment" Value="Left" /> </Style> <Style x:Key="horizontalLineStyleTop" TargetType="Line" BasedOn="{StaticResource horizontalLineStyle}" > <Setter Property="VerticalAlignment" Value="Top" /> </Style> </ResourceDictionary>
and how it is used? how will the styles be applied to draw the grid lines?
<Window x:Class="GridLines.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid x:Name="Grid" Margin="20" > <Grid.RowDefinitions> <RowDefinition Height="20"/> <RowDefinition Height="20"/> <RowDefinition Height="20"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="20" /> <ColumnDefinition Width="20" /> <ColumnDefinition Width="20" /> </Grid.ColumnDefinitions> <Line Grid.Column="0" Style="{StaticResource verticalLineStyleLeft}" /> <Line Grid.Column="0" Style="{StaticResource verticalLineStyle}" /> <Line Grid.Column="1" Style="{StaticResource verticalLineStyle}" /> <Line Grid.Column="2" Style="{StaticResource verticalLineStyle}" /> <Line Grid.Column="3" Style="{StaticResource verticalLineStyle}" /> <Line Grid.Row="0" Style="{StaticResource horizontalLineStyleTop}" /> <Line Grid.Row="0" Style="{StaticResource horizontalLineStyle}" /> <Line Grid.Row="1" Style="{StaticResource horizontalLineStyle}" /> <Line Grid.Row="2" Style="{StaticResource horizontalLineStyle}" /> <Line Grid.Row="3" Style="{StaticResource horizontalLineStyle}" /> </Grid> </Window>
发表评论
-
wpf - example to enhance ComboBox for AutoComplete
2014-09-19 15:56 1979first let’s see an example ... -
Investigate and troubleshoot possible memory leak issue of .NET application
2014-07-31 10:42 0Hi All, I would like to sh ... -
C# – CoerceValueCallback合并、替换元数据值
2013-08-05 21:59 1929Topic: C# – CoerceValueCallbac ... -
WPF – Virtualization – VirutalizationStackPanel and ItemsPanelTemplate
2013-08-05 21:55 1420Topic: WPF – Virtualization – ... -
wpf – ListView交替背景色
2013-07-02 20:56 6554Wpf – Alternate background col ... -
C# - 简单介绍TaskScheduler
2013-06-29 17:18 12054标题: C# - 简单介绍TaskSchedulerTit ... -
c# - Get enum from enum attribute
2013-06-27 21:32 1251DescriptionAttribute gives the ... -
C# - PInvoke, gotchas on the RegisterClassEx and the CreateWindowEx
2013-06-24 13:49 2576I get an exception message li ... -
c# - Use PInvoke to create simple win32 Application
2013-06-24 11:59 10952In this post, .net platform h ... -
c# - Linq's Select method as the Map function
2013-06-19 18:47 1293If you comes from a functiona ... -
c# - Tips of Linq expression Any to determine if a collection is Empty
2013-06-19 18:29 939When you are @ the linq expres ... -
myth buster - typeof accepting array of types not acceptable
2013-06-19 17:17 817I have seen from some book whe ... -
windows - trying to create WIN32 application with PInvoke
2013-06-19 14:34 0While it is stupid to do such ... -
wpf - BehaviorBase and one use examples
2013-06-18 18:41 1316Behavior is something that we ... -
WPF - Setting foreground color of Entire window
2013-06-13 16:00 1925You might as well as I would s ... -
WPF - Enhanced TabControl - TabControlEx aka Prerendering TabControl
2013-06-13 13:12 5337As an opening word, let's che ... -
wpf - ControlTemplate and AddLogicChild/RemoveLogicalChild
2013-06-10 15:42 1190Recently I was trying to debug ... -
c# - P/Invoke, DllImport, Marshal Structures and Type conversions
2013-06-05 15:25 1716P/Invoke as in the following q ... -
c# - A study on the NativeWindow - encapsulate window handle and procedure
2013-06-05 14:40 6098NativeWindow gives you a way t ... -
WCF - Notify server when client connects
2013-06-03 18:19 1226It is sometimes very importan ...
相关推荐
通用WPF主题控件包rubyer-wpf-master是一款专为Windows Presentation Foundation (WPF) 应用程序设计的开源UI框架。它提供了丰富的主题和控件,旨在帮助开发者快速构建美观且用户友好的应用程序界面。在2.0.0版本中...
gong-wpf-dragdrop, GongSolutions.WPF.DragDrop 库是WPF的拖动'n'拖放框架 简介GongSolutions.WPF.DragDrop 库是一个易于使用的拖拉'n'拖放框架。特性使用 MVVM: 拖放逻辑可以放在ViewModel中。 代码不需要放在in中...
C#开发WPF-Silverlight动画及游戏系列教程-深蓝色右手 C#开发WPF-Silverlight动画及游戏系列教程-深蓝色右手 C#开发WPF-Silverlight动画及游戏系列教程-深蓝色右手
WPF的基本空间历程,使用.net core3.0.1版本
Bootstrap-WPF 样式是一种将流行的前端框架 Bootstrap 的设计风格应用于 WPF(Windows Presentation Foundation)应用程序的方法。Bootstrap 是一个广泛使用的开源工具包,主要用于构建响应式、移动设备优先的网页...
通过深入研究WPF-Diagram-Designer的源代码(如WPF-Diagram-Designer-master文件夹中的内容),开发者不仅可以学习到如何在WPF中构建复杂的图形界面,还可以了解到图形编辑器的设计原理和实现细节,对于提升图形应用...
“wpf---StatusBar”这个标题表明我们将探讨的是WPF(Windows Presentation Foundation)框架中的StatusBar组件。WPF是.NET Framework的一部分,用于构建桌面应用程序,它提供了丰富的用户界面(UI)功能。StatusBar...
**WPF - 强大的图表技术** Windows Presentation Foundation (WPF) 是Microsoft开发的一个用于构建桌面应用程序的框架,它提供了丰富的图形系统,包括对2D和3D图形的强大支持。在WPF中,开发人员可以利用各种图表...
在这个“wpf-datagrid-access DB”主题中,我们将深入探讨如何利用WPF Datagrid与Microsoft Access数据库进行交互,实现数据的读取、更新和保存。 1. **WPF Datagrid简介** - Datagrid是WPF中的一个数据展示控件,...
title: "WPF 如何给 Grid 的某一行添加背景色"其实在 WPF 里面是不存在单独设置 Grid 的某一行的配色,但是想要达到这个视觉效果,可以通过
Customize the MVVM pattern for your projects needs by comparing the various implementation styles In Detail MVVM (Model View View Model) is a Microsoft best practices pattern for working in WPF and...
C#开发WPF-Silverlight动画及游戏系列教程-深蓝色右手 C#开发WPF-Silverlight动画及游戏系列教程-深蓝色右手 C#开发WPF-Silverlight动画及游戏系列教程-深蓝色右手
超酷WPF数据可视化,全套源程序,非常适合做数据可视化的程序员使用,WPF,XAML。 找了好久的资源,附有很多很详细的插图,是大数据时代不可缺少的可视化学习数据,仅供大家学习使用请勿用做商业用途。与大家一起...
在本文中,我们将深入探讨WPF(Windows Presentation Foundation)布局系统,通过`wpf-layout-sample`这个示例项目,揭示其强大的布局管理能力。WPF是.NET Framework的一部分,提供了丰富的用户界面(UI)开发工具,...
WPF-Ribbon则是专门针对WPF平台实现的Ribbon组件,它为开发者提供了在WPF应用程序中集成这种现代用户界面的能力。 1. **Ribbon布局** - Ribbon界面通常包含多个主要区域:快速访问工具栏(QAT)、主选项卡、上下文...
Prism-Samples-Wpf-master11-15的VS2017版本实现,下载手动重新安装一下nuget包即可,方便大家学习
标题 "WPF-WIFI.zip" 暗示了这是一个与Windows Presentation Foundation (WPF) 相关的项目,特别关注于模拟手机信号和WIFI信号的显示。WPF是.NET Framework的一部分,它提供了一个用于构建桌面应用程序的强大而灵活...
标题"Navigation-Drawer-Sidebar-Menu-in-WPF-master.zip"提示我们这是一个关于WPF应用的项目,它包含了一个可展开和收缩的左侧导航菜单。描述中的“WPF左侧展开收缩图标导航菜单”进一步确认了这一功能。通过分析...
总结,创建“3D Bar chart custom control using WPF-VS2008”需要掌握以下关键技术点: 1. WPF的3D图形渲染,包括`Viewport3D`,`Model3D`,`GeometryModel3D`和数据绑定。 2. C#编程,用于处理用户交互和数据操作...
Grid是WPF中最基本且强大的布局容器之一,它将窗口划分为一个二维网格,每个单元格可以容纳一个或多个控件。Grid的一个显著特点是其灵活性,允许对行和列进行精确控制,包括合并单元格和自定义高度和宽度。 1. 多...