加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

XAML XMLNS:本地C#

发布时间:2020-12-15 18:26:23 所属栏目:百科 来源:网络整理
导读:我正在学习MVVM教程,我有以下代码,用Xaml编写: Window x:Class="WPFMVVM.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WPFMVVM; a
我正在学习MVVM教程,我有以下代码,用Xaml编写:
<Window x:Class="WPFMVVM.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WPFMVVM; assembly=WPFMVVM"
    Title="MainWindow" Height="388" Width="545">

xmlns:local行抱怨说没有引用WPFMVVM程序集.虽然这是我正在组装的组件.

谁知道为什么?

谢谢

解决方法

你不能在那里有空位.如果它是你工作的程序集只是不指定程序集.
xmlns:local="clr-namespace:WPFMVVM"

程序集参数用于引用的程序集.另见MSDN article on XAML namespaces.

assembly can be omitted if the clr-namespace referenced is being defined within the same assembly as the application code that is referencing the custom classes. Or,an equivalent syntax for this case is to specify assembly=,with no string token following the equals sign.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读