- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个使用自定义窗口控件的程序。在 VS2013 中,窗口在设计 View 中呈现良好,在 VS2015 中打开的解决方案完全相同。编译并在运行时正常工作。
相关代码的片段在这里:
<control:CustomWindow x:Class="CategoryView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:control="clr-namespace:ClassAccounts;assembly=ClassAccounts"
xmlns:l="clr-namespace:WpfAccounts"
Title="Category" Width="470" Height="485" WindowStartupLocation="CenterScreen" OKVisibility="True">
<Window.Resources>
<CollectionViewSource Source="{Binding Categories}" x:Key="Categories"/>
<CollectionViewSource Source="{Binding Headings}" x:Key="Headings"/>
<DataTemplate x:Key="CategoryTemplate">
<TextBlock Text="{Binding comment}" Margin="0" Foreground="{Binding forecolor}"/>
</DataTemplate>
</Window.Resources>
<Grid>
...
</Grid>
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:WpfAccounts"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/ClassAccounts;component/Themes/Generic.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- Region SubMenu -->
<MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
<!-- Separator -->
<Style TargetType="{x:Type Separator}" x:Key="SeparatorStyle">
<Setter Property="Height" Value="1"/>
<Setter Property="Background" Value="{StaticResource CustomDarkBlue}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Rectangle Height="{TemplateBinding Height}" Fill="{StaticResource CustomWhite}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
...
<!-- End Region -->
</ResourceDictionary>
</Application.Resources>
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Globalization
Imports System.Resources
Imports System.Windows
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("Accounts")>
<Assembly: AssemblyDescription("Account Program")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("Accounts")>
<Assembly: AssemblyCopyRight("Copyright © 2013-4 Andrew Powell")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'In order to begin building localizable applications, set
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file
'inside a <PropertyGroup>. For example, if you are using US english
'in your source files, set the <UICulture> to "en-US". Then uncomment the
'NeutralResourceLanguage attribute below. Update the "en-US" in the line
'below to match the UICulture setting in the project file.
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)>
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
'1st parameter: where theme specific resource dictionaries are located
'(used if a resource is not found in the page,
' or application resource dictionaries)
'2nd parameter: where the generic resource dictionary is located
'(used if a resource is not found in the page,
'app, and any theme specific resource dictionaries)
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("c7920515-ec57-40d4-bccb-8f5b16be77d0")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ClassAccounts">
<!-- Region Colours -->
<!-- Control colors -->
<SolidColorBrush x:Key="CustomWhite" Color="White"/>
<SolidColorBrush x:Key="CustomDarkBlue" Color="#8DA3C1"/>
<SolidColorBrush x:Key="CustomGray" Color="LightGray"/>
<SolidColorBrush x:Key="CustomDarkHighlight" Color="#5082A4"/>
<!-- Submenu item highlight -->
<SolidColorBrush x:Key="CustomLightHighlight" Color="#3399FF"/>
<!-- TreeviewItem highlight -->
<Color x:Key="CustomLightHighlightC" A="#FF" R="#33" G="#99" B="#FF"/>
<SolidColorBrush x:Key="CustomBackground" Color="#B5CBEF"/>
<Color x:Key="CustomBackgroundC" A="#FF" R="#B5" G="#CB" B="#EF"/>
<SolidColorBrush x:Key="CustomHighlightedControlGlyph" Color="#3C7FB1"/>
<SolidColorBrush x:Key="CustomHighlightedControlBorder" Color="#222"/>
<SolidColorBrush x:Key="CustomPressedControlGlyph" Color="#003366"/>
<SolidColorBrush x:Key="CustomPressedControlBorder" Color="#526C7B"/>
<SolidColorBrush x:Key="CustomPressedControlBackground" Color="#595959"/>
<SolidColorBrush x:Key="CustomGlyph" Color="#444"/>
<!-- Window Colors -->
<SolidColorBrush x:Key="CustomWindowBorder" Color="#395984"/>
<SolidColorBrush x:Key="CustomHeaderLight" Color="#E7EBF7"/>
<Color x:Key="CustomHeaderLightC" A="#FF" R="#E7" G="#EB" B="#F7"/>
<SolidColorBrush x:Key="CustomHeaderDark" Color="#CEE3FF"/>
<Color x:Key="CustomHeaderDarkC" A="#FF" R="#CE" G="#E3" B="#FF"/>
<SolidColorBrush x:Key="CustomControl" Color="Gray"/>
<!-- End Region -->
<!-- Region Window -->
<!-- Window Button style -->
<Style TargetType="{x:Type Button}" x:Key="WindowButtonStyle">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="FontFamily" Value="Webdings"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Foreground" Value="{StaticResource CustomControl}"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Border x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Margin="0" Padding="0" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Black"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="LightGray"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Window style -->
<Style TargetType="{x:Type local:CustomWindow}" x:Key="{x:Type local:CustomWindow}">
<Setter Property="WindowStyle" Value="None"/>
<Setter Property="ResizeMode" Value="NoResize"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="AllowsTransparency" Value="True"/>
<Setter Property="ShowInTaskbar" Value="True"/>
<Setter Property="Icon" Value="\coins.ico"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:CustomWindow}">
<Border Width="Auto" Height="Auto" Name="windowFrame" BorderBrush="{StaticResource CustomWindowBorder}" BorderThickness="1" CornerRadius="0,20,20,20">
<Border.Background>
<LinearGradientBrush>
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="{StaticResource CustomHeaderLightC}" Offset="0.0"></GradientStop>
<GradientStop Color="{StaticResource CustomHeaderDarkC}" Offset="0.25"></GradientStop>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" x:Name="tbTitle" Text="{TemplateBinding Title}" FontSize="14" Margin="0" Padding="4"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0,5,15,0" HorizontalAlignment="Right" VerticalAlignment="Top" Background="Transparent">
<Button x:Name="RefreshButton" Content="q" Style="{StaticResource WindowButtonStyle}"/>
<Button x:Name="MinimizeButton" Content="0" Style="{StaticResource WindowButtonStyle}"/>
<Button x:Name="OKButton" Content="a" Style="{StaticResource WindowButtonStyle}" IsDefault="True"/>
<Button x:Name="CloseButton" Content="r" Style="{StaticResource WindowButtonStyle}" IsCancel="True"/>
</StackPanel>
</Grid>
<Grid x:Name="grdMain" Grid.Row="1" Background="{StaticResource CustomBackground}">
<AdornerDecorator>
<ContentPresenter/>
</AdornerDecorator>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="15,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
<TextBlock x:Name="tbStatusLeft" FontSize="14" Margin="0,0,0,0" Width="150" Padding="2"/>
<TextBlock x:Name="tbStatusLeft2" FontSize="14" Margin="0,0,0,0" Width="150" Padding="2"/>
<TextBlock x:Name="tbStatusLeft3" FontSize="14" Margin="0,0,0,0" Width="150" Padding="2"/>
</StackPanel>
<Canvas x:Name="canStatusMiddle" Grid.Column="1" ClipToBounds="True">
<TextBlock x:Name="tbStatusMiddle" FontSize="14" Margin="0,0,0,0" Padding="2" TextAlignment="Center"/>
</Canvas>
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="0,0,15,0" HorizontalAlignment="Right" VerticalAlignment="Top">
<TextBlock x:Name="tbStatusRight3" FontSize="14" Margin="0,0,0,0" Width="150" Padding="2" TextAlignment="Right"/>
<TextBlock x:Name="tbStatusRight2" FontSize="14" Margin="0,0,0,0" Width="150" Padding="2" TextAlignment="Right"/>
<TextBlock x:Name="tbStatusRight" FontSize="14" Margin="0,0,0,0" Width="150" Padding="2" TextAlignment="Right"/>
</StackPanel>
</Grid>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="OKVisibility" Value="False">
<Setter TargetName="OKButton" Property="Visibility" Value="Collapsed"/>
</Trigger>
<Trigger Property="RefreshVisibility" Value="False">
<Setter TargetName="RefreshButton" Property="Visibility" Value="Collapsed"/>
</Trigger>
<Trigger Property="ExtraStatus" Value="False">
<Setter TargetName="tbStatusLeft2" Property="Visibility" Value="Collapsed"/>
<Setter TargetName="tbStatusLeft3" Property="Visibility" Value="Collapsed"/>
<Setter TargetName="tbStatusRight2" Property="Visibility" Value="Collapsed"/>
<Setter TargetName="tbStatusRight3" Property="Visibility" Value="Collapsed"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- End Region-->
最佳答案
我发现了一些事情。我在我发布的示例项目中注意到它实际上在 VS2013 中没有正确呈现。 Generic.xaml 中的关键行是这样的:
<Style TargetType="{x:Type local:CustomWindow}" x:Key="{x:Type local:CustomWindow}">
<Style TargetType="{x:Type local:CustomWindow}">
As shown in the first example above, setting the TargetType property to TextBlock without assigning the style with an x:Key allows your style to be applied to all TextBlock elements. What actually happens is that doing so implicitly sets the x:Key to {x:Type TextBlock}. This also means that if you give the Style an x:Key value of anything other than {x:Type TextBlock}, the Style would not be applied to all TextBlock elements automatically. Instead, you need to apply the style to the TextBlock elements explicitly.
<Style TargetType="{x:Type local:CustomWindow}" x:Key="CustomWindow">
<Style="{DynamicResource CustomWindow}">
关于wpf - VS2015 不在设计 View 中呈现自定义窗口控件(适用于 VS2013),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31572510/
我在我的 Xcode 项目目录中输入了以下内容: keytool -genkey -v -keystore release.keystore -alias mykey -keyalg RSA \
假设我有一个像这样的 DataFrame(或 Series): Value 0 0.5 1 0.8 2 -0.2 3 None 4 None 5 None
我正在对一个 Pandas 系列进行相对繁重的应用。有什么方法可以返回一些打印反馈,说明每次调用函数时在函数内部进行打印还有多远? 最佳答案 您可以使用跟踪器包装您的函数。以下两个示例,一个基于完成的
我有一个 DataFrame,其中一列包含列表作为单元格内容,如下所示: import pandas as pd df = pd.DataFrame({ 'col_lists': [[1, 2
我想使用 Pandas df.apply 但仅限于某些行 作为一个例子,我想做这样的事情,但我的实际问题有点复杂: import pandas as pd import math z = pd.Dat
我有以下 Pandas 数据框 id dist ds 0 0 0 0 5 1 0 0 7 2 0 0
这发生在我尝试使用 Gradle 构建时。由于字符串是对象,因此似乎没有理由发生此错误: No signature of method: java.util.HashMap.getOrDefault(
您好,有人可以解释为什么在 remaining() 函数中的 Backbone 示例应用程序 ( http://backbonejs.org/examples/todos/index.html ) 中
我有两个域类:用户 class User { String username String password String email Date dateCreated
问题陈述: 一个 pandas dataframe 列系列,same_group 需要根据两个现有列 row 和 col 的值从 bool 值创建。如果两个值在字典 memberships 中具有相似
apporable 报告以下错误: error: unknown type name 'MKMapItem'; did you mean 'MKMapView'? MKMapItem* destina
我有一个带有地址列的大型 DataFrame: data addr 0 0.617964 IN,Krishnagiri,635115 1 0.635428 IN,Chennai
我有一个列表list,里面有这样的项目 ElementA: Number=1, Version=1 ElementB: Number=1, Version=2 ElementC: Number=1,
我正在编译我的源代码,它只是在没有运行应用程序的情况下终止。这是我得到的日志: Build/android-armeabi-debug/com.app4u.portaldorugby/PortalDo
我正在尝试根据另一个单元格的值更改单元格值(颜色“红色”或“绿色”)。我运行以下命令: df.loc[0, 'Colour'] = df.loc[0, 'Count'].apply(lambda x:
我想弄清楚如何使用 StateT结合两个 State基于对我的 Scalaz state monad examples 的评论的状态转换器回答。 看来我已经很接近了,但是在尝试申请 sequence
如果我已经为它绑定(bind)了集合,我该如何添加 RibbonLibrary 默认的快速访问项容器。当我从 UI 添加快速访问工具项时,它会抛出 Operation is not valid whi
在我学习期间Typoclassopedia我遇到了这个证明,但我不确定我的证明是否正确。问题是: One might imagine a variant of the interchange law
我是一名优秀的程序员,十分优秀!