小编a7m*_*dx7的帖子

如何将xaml属性绑定到另一个类中的静态变量?

我有这个xaml文件,我尝试将Text-block Background绑定到另一个类中的静态变量,我该如何实现?

我知道这可能很愚蠢,但我刚从Win-forms中感动并感到有点失落.

这就是我的意思:

<TextBlock Text="some text"
           TextWrapping="WrapWithOverflow"
           Background="{Binding Path=SomeVariable}" />
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml

32
推荐指数
2
解决办法
3万
查看次数

IdentityUserLogin不包含User的定义

当我突然遇到这个错误时,我正在尝试构建一个asp.net MVC-5项目

错误1'Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin'不包含'User'的定义,也没有扩展方法'User'接受类型为'Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin'的第一个参数'(你缺少using指令或程序集引用?)D:\ Projects\FULL\Control Panel\ControlPanel.Web\Models\IdentityModels.cs 53 56 ControlPanel.Web

我不知道它的性质,前提是我已经通过nugget安装了所有必需的软件包.

我有错误

我想要做的就是配置一些关系!

一些不在OnModelCreating覆盖中编译的代码

asp.net-mvc entity-framework visual-studio-2013 asp.net-mvc-5 asp.net-identity

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

WPF RichTextBox语法突出显示问题

大家好,我一直在研究一个有文本编辑器的WPF应用程序,这个文本编辑器应该应用一些样式或着色一些标记(关键字)来突出显示它并使其显而易见,问题是我非常努力但是我仍然得到相同的结果,即用户在关键字被设置样式后输入整个文本中的一个关键字!试想一下,如果你在"C#"中键入"string"关键字,那么它之后的整个文本将会显示为蓝色.

这是我使用的代码:

    static List<string> tags = new List<string>();
    static List<char> specials = new List<char>();
    static string text;
    #region ctor
    static MainWindow()
    {
        string[] specialWords = { "string", "char", "null" };              
        tags = new List<string>(specialWords);     
        // We also want to know all possible delimiters so adding this stuff.     
        char[] chrs = {
            '.',
            ')',
            '(',
            '[',
            ']',
            '>',
            '<',
            ':',
            ';',
            '\n',
            '\t',
            '\r'
        };
        specials = new List<char>(chrs);
    }
    public MainWindow()
    {
        InitializeComponent();
    }
        #endregion
    //Now I should check statically …
Run Code Online (Sandbox Code Playgroud)

c# wpf richtextbox styling text-styling

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