小编Ale*_*tin的帖子

扩展的WPF工具包 - 调整子窗口的大小

我使用的是librariay Extended WPF Toolkit

https://wpftoolkit.codeplex.com/

可以像普通的窗口一样调整ChildWindow的大小吗?

文档显示了一些似乎相关的属性,但无法通过xaml访问它们.https://wpftoolkit.codeplex.com/wikipage?title=ChildWindow

这是我尝试的例子:

<Window x:Class="WpfApplication1.MainWindow"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:local="clr-namespace:WpfApplication1"
         xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
         xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
         xmlns:s="clr-namespace:System;assembly=mscorlib">
    <xctk:WindowContainer>
        <xctk:ChildWindow WindowBackground="Blue"
                    Left="75"
                    Top="50"
                    Width="275"
                    Height="125"
                    WindowState="Open" Canvas.Top="52">
            <TextBlock Text="This is a Child Window" Padding="10"/>
        </xctk:ChildWindow>
    </xctk:WindowContainer>
</Window>
Run Code Online (Sandbox Code Playgroud)

wpf xaml wpftoolkit

6
推荐指数
1
解决办法
2121
查看次数

为什么有些文化默认围绕货币小数?

我注意到,当使用框架函数string.Format格式化货币值时,在某些文化中,此函数默认情况下会舍入小数.例如,在使用马来西亚林吉特时:

CultureInfo culture = new CultureInfo("ms-MY");
someLabel.Content = string.Format(culture,"{0:C}", 1.64m);
Run Code Online (Sandbox Code Playgroud)

产出:RM2

但是,当使用其他货币(如美元,欧元或其他货币)时,您将获得原始值,例如:

CultureInfo culture = new CultureInfo("sv-SE");
someLabel.Content = string.Format(culture,"{0:C}", 1.64m);
Run Code Online (Sandbox Code Playgroud)

产量:1.64kr

我知道我可以指定CultureInfo类中的小数位数,但问题是,为什么这种情况发生在一些货币而不是其他货币?预计一些货币默认为四舍五入?

.net c# culture string.format

5
推荐指数
1
解决办法
1342
查看次数

ServiceBehavior属性是否由其他类继承?

我有几个WCF服务,这些服务共享一些常用方法.所以,我用这些方法创建了一个基类(不是WCF服务),并使所有WCF服务都从这个类继承.像这样的东西:

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.PerCall)]
    public abstract class BaseService
Run Code Online (Sandbox Code Playgroud)

并且其中一个WCF服务:

public class ExampleService : BaseService, IExampleService
    {
Run Code Online (Sandbox Code Playgroud)

我正在使用ServiceBehavior属性来设置ConcurrencyMode和InstanceContextMode值,我的问题是:使用ServiceBehavior属性标记基类是正确的,并期望所有服务继承ServiceBehavior属性的值,或者我应该标记所有WCF服务一个接一个?

c# wcf inheritance attributes

3
推荐指数
1
解决办法
1628
查看次数

标签 统计

c# ×2

.net ×1

attributes ×1

culture ×1

inheritance ×1

string.format ×1

wcf ×1

wpf ×1

wpftoolkit ×1

xaml ×1