XAML Designer在我的本地命名空间中找不到任何文件! [英] XAML Designer can not find any files in my local namespace!

查看:98
本文介绍了XAML Designer在我的本地命名空间中找不到任何文件!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已被多次询问,而且我已经完成了所有这些问题。希望我不会错过以前的答案中的一些内容,但我很难过。



昨天我的应用程序工作正常,但今天我启动它现在我找不到任何文件引用,包括我在外部文件中定义的ViewModels或DependencyProperties。我在用VB编写代码(正如你所看到的),我尝试过改变/添加命名空间而没有任何东西!



如果有人对此问题有所了解我全是耳朵!



解决方案结构



解决方案图片



XAML代码



 <   Window   

xmlns:l = clr-namespace:PrairieWestIceCreamWPF

< span class =code-attribute> xmlns = http:// schemas .microsoft.com / winfx / 2006 / xaml / presentation

xmlns:x = http:// schemas.microsoft.com/winfx/2006/xaml\"

x:Class = WeeklyOutlookView 标题 = WeeklyOutlookView 名称 = WeeklyOutlookView 高度 = 463.5 宽度 = 1280 l:WindowBehavior.WindowClosing = {Binding WindowClosingCommand} >


< Window.DataContext >
< l:WeeklyOutlookViewModel / >
< / Window.DataContext < span class =code-keyword>>





错误



名称WindowBehavior在名称空间clr-namespace:PrairieWestIceCreamWPF中不存在



名称WeeklyOutlookViewModel在名称空间clr-namespace:PrairieWestIceCreamWPF中不存在

解决方案

终于找到了罪魁祸首!!



在我的工作中,我们的桌面托管在网络共享上。我带了两个我在家工作的应用程序,暂时将应用程序文件放在桌面上进行一些快速的小改动。事实证明,WPF Designer中存在一个错误,如果从共享运行应用程序,应用程序将无法解析程序集引用。一旦我把它移到我当地的D盘,一切都运转良好。



在这里找到答案 - >

http: //social.msdn.microsoft.com/Forums/vstudio/en-US/75c4cc8d-9a81-4bda-84f0-f619f7493b3b/vs2010-xaml-namespace-intellisense-not-working?forum=vswpfdesigner

请参阅我对您的解决方案1的评论。这根本不是解决方案。实际上,引用同一项目中定义的类型根本不是问题。这不容易,很容易。



首先,通过输入xmlns:开始将 xmlns 属性添加到顶级XAML元素。 intellisense将显示您可以引用的本地命名空间的变体。选择合适的一个;你会完成的。很抱歉,如果Intellisense没有处理某些设置。我从来没有遇到过这个错误,可以向你保证它一般都在工作。你可以做什么?找出一个有效的命名空间值语法并学习它,手动输入。



-SA

I know this question has been asked multiple times, and I've gone through them all. Hopefully I didn't just miss something in the previous answers, but I'm stumped.

My application was working fine yesterday, but today I booted it up and now none of my file references, including ViewModels or DependencyProperties which I have defined in external files, can be found. I'm coding in VB (as you'll see), I've tried changing / adding Namespaces and nothing!

If someone has some insight into this issue I'm all ears!

Solution Structure

Image Of Solution

XAML Code

<Window

xmlns:l="clr-namespace:PrairieWestIceCreamWPF"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    

x:Class="WeeklyOutlookView" Title="WeeklyOutlookView" Name="WeeklyOutlookView"    Height="463.5" Width="1280" l:WindowBehavior.WindowClosing="{Binding WindowClosingCommand}">


<Window.DataContext>
    <l:WeeklyOutlookViewModel />
</Window.DataContext>



Errors

The Name "WindowBehavior" does not exist in the namespace "clr-namespace:PrairieWestIceCreamWPF"

The Name "WeeklyOutlookViewModel" does not exist in the namespace "clr-namespace:PrairieWestIceCreamWPF"

解决方案

Finally found the culprit!!

At my work, our desktops are hosted on a network share. I had brought two applications I was working on from home and dropped the application files temporarily on the desktop to make some quick minor changes. Turns out there is a bug in the WPF Designer where the application will not be able to resolve assembly references if the application is being run from a share. As soon as I moved it to my local D drive, everything work perfectly.

Found answer here ->
http://social.msdn.microsoft.com/Forums/vstudio/en-US/75c4cc8d-9a81-4bda-84f0-f619f7493b3b/vs2010-xaml-namespace-intellisense-not-working?forum=vswpfdesigner


Please see my comment to your "Solution 1". This is not a solution at all. Actually, referencing the types defined in the same project is not a problem at all. It is not easy, it is very easy.

To start, start adding the xmlns attribute to your top XAML element by typing "xmlns:". The intellisense will show you the variants of local namespaces you can reference. Choose an appropriate one; and you will be done. Sorry if Intellisense is not working on some settings. I never faced this bug and can assure you that it is generally working. What you can do? Find out a single case of valid syntax for namespace value and learn it, enter manually.

—SA


这篇关于XAML Designer在我的本地命名空间中找不到任何文件!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆