Page 1 of 1

WPF Designer

Posted: Tue May 14, 2019 7:24 am
by TooTallTommyT
I was hoping that the general forum would come up with some answers, but nothing so far, so...

I've upgrade to the latest versions and I still get (even a brand new project) an "Invalid Markup" on my designer window. If hover over either of the two controls in the xaml page, textblock or textbox, I get a hover message: "Textblock is not supported in a Windows Presentation Foundation (WPF) project."

Any idea when this might finally get fixed. It's hard to design a screen if I can't see what I'm doing.

Thanks

Re: WPF Designer

Posted: Thu May 16, 2019 5:38 am
by JS-Support @Userware
Hi,

I believe that in v2.0 Preview 0.4 the XAML Preview is working only in some specific case (that is, if version 1.x is installed AND you are using VS 2015 or 2017). We are working to fix the XAML Preview in version 2.x.

However, you should not be getting errors in the XAML Text Editor. Could you please post a screenshot showing the design-time errors?

Thanks

Re: WPF Designer

Posted: Fri May 17, 2019 3:58 am
by TooTallTommyT
This screen shot is just after creating a brand new project in VS2017, and compiling.

Xaml Editor Errors.PNG
Xaml Editor Errors.PNG (192.1 KiB) Viewed 23516 times

Re: WPF Designer

Posted: Fri May 17, 2019 4:23 am
by Username
I'm having that error too when I just create a new empty project without touch in 1 line of code... I'm using VS2019

Re: WPF Designer

Posted: Fri May 17, 2019 5:19 am
by JS-Support @Userware
Thanks. We are looking into this. We'll keep you updated asap.

Re: WPF Designer

Posted: Mon May 20, 2019 7:17 am
by Username
News?

Re: WPF Designer

Posted: Mon May 20, 2019 11:55 pm
by JS-Support @Userware
It's due to the fact that v2.0 Preview 0.5 does not come with the XAML Editor yet (this is listed in the "known issues" section of the release notes of v2.0 Preview 0.5).

As a temporary workaround, you can install the version 1.x of CSHTML5, which installs the appropriate XAML Editor into your Visual Studio (only on VS 2012, 2013, 2015, or 2017 - please note that VS 2019 is not yet supported with v1.x). It will fix the issue while waiting for the XAML Editor to be directly integrated into v2.0.

Thanks.

Re: WPF Designer

Posted: Wed May 22, 2019 11:09 am
by TooTallTommyT
Actually, I had this problem with versions 1.xx in VS2015 and VS2017 as well. This is one of the reasons why I never tried to do anything serious with this framework. I have a project I'm eager to try, and with the features that are coming out with ver 2.xxx, the framework should give me enough to do what I want, but I waited to see if this issue would be fixed...which it hasn't. I can do work arounds, but it's frustrating and quite interrupts the flow.

Re: WPF Designer

Posted: Thu May 23, 2019 3:23 am
by JS-Support @Userware
Thanks. We'll keep you updated asap.

Re: WPF Designer

Posted: Fri May 24, 2019 8:59 am
by rthomas
Hi,

As a workaround you can create a real XAML project and reference (Add exsting -> as Link) the CSHTML5 files in it.

Remi

Re: WPF Designer

Posted: Tue Jun 04, 2019 4:45 am
by TooTallTommyT
Have you actually done this, rthomas? I don't see how this works. I know how to add files by link, but I do not see how to "reference" those links once I have added them. Even if I could, how do then test it in the browser, since this isn't an actual CSHTML5 app? Do you have a sample project I could look at?

What say you JS-Support, is this a viable solution? Can you chime in and give me some insight?

Re: WPF Designer

Posted: Fri Jul 12, 2019 2:56 am
by JS-Support @Userware
Hi,

It is definitely possible to share .xaml files between CSHTML5 projects (of type "Migration Edition") and WPF projects, but it is not convenient because the namespaces need to be the same.

Support for the XAML preview in v2.x should be available before the end of August.

Thank you very much.

Re: WPF Designer

Posted: Mon Mar 02, 2020 12:38 am
by rthomas
Hi,

The trick is to use conditionnal using

#if CSHTML5
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using System.Windows.Browser;
#else
using System.Windows.Threading;
using System.Windows.Controls;
using System.Windows;
#endif

and it works great.

Remi

Re: WPF Designer

Posted: Tue Apr 07, 2020 3:34 pm
by stevyrino
I am getting the invalid markup issue when trying to use the Designer using the demo Calculator app solution.
The solution will run on Start. VS seems to ignore the errors.

I am using CSHTML5_v2_0_Preview_0_6_Alpha49_068 with VS2017. Does the same thing with VS2019.

I had some hope for this tool, but now not so sure.

Re: WPF Designer

Posted: Wed Apr 08, 2020 5:09 am
by JS-Support @Userware
Thanks. We have some issues with the XAML designer. As a workaround, to edit XAML files, please right-click on them in Solution Explorer, then click "Open With..." and choose the XML (not XAML) editor.

Re: WPF Designer

Posted: Sat Apr 11, 2020 6:12 am
by MD Rana
at the 1st time building your app you provide a sample site demo please upload that again that will help us