Edit Xaml files on debuging Visual studio 2019, WPF

user8253046

I want to Edit UI XAML files with my program running and see these changes without to stop my program...

When I change these files right now It just o nothing until I close my program and start again.

For exmaple: this is my xaml code:

<Window x:Class="WpfApp4.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp4"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>

    </Grid>
</Window>

http://prntscr.com/nwiw0o

I see an empty white screen

When I change it (on debug) to

<Window x:Class="WpfApp4.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp4"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800" Background="Blue">
    <Grid>

    </Grid>
</Window>

http://prntscr.com/nwiw7q

Nothing is change

But when I restart my program It runs this blue screen... http://prntscr.com/nwiwiw

I think its something about debugging option? this is my page open list

http://prntscr.com/nwiwtu

Andy

You probably don't have "Edit and continue" enabled, because you can just edit xaml and see the result immediately if you do.

From the Debug menu, choose Options. On the left Debugging should be selected for you and the default will be the first option - General. If that isn't selected, do so.

Scroll the right panel down.

Tick the Enable UI debugging tools for XAML and at least Enable XAML Edit and Continue.

enter image description here

You should then be able to change simple properties in XAML and see your changes reflected immediately in the running UI. It does not work for everything though.

https://devblogs.microsoft.com/visualstudio/ui-development-made-easier-with-xaml-edit-continue/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Can't edit XAML designer in Visual Studio 2019

Visual Studio 2015 WPF XAML Editor cannot open XAML files

How to do a batch run to apply "XAML styler" to all xaml files in a Visual Studio 2019 project

How to fix a xaml.cs indentation problem in WPF (Visual Studio 2019)?

Is it safe to edit .csproj file in Visual Studio 2019?

Visual Studio 2019 Edit and Continue not working

Visual Studio 2015 XAML Designer crashes with WPF

Visual Studio 2015 XAML files freezing

Visual Studio Tools for Office Edit multiple files

Generate the EDMX backing files in Visual Studio 2019

Linking multiple files with MASM and Visual Studio 2019

Visual Studio 2019 is not running other .cpp files

Xaml snippets Visual studio 2019 (created but does not work)

Having problems previewing XAML design in Visual Studio 2019

Is it possible to get Image elements to render in the XAML designer for Visual Studio 2019?

Visual Studio 2019 Xaml Editor: Project Code button is disabled

How to disable Edit Project when double click on Visual Studio 2019?

How to select and edit multiple word with same text in visual studio 2019?

activating a custom new window while debuging in visual studio

Visual Studio 2017 Chrome JavaScript Debuging - Not hitting break point

WPF xaml Visual Studio keeps automatically changing pathway to my resource

Template for F# and WPF (Visual Studio 2019 Community)?

Migration to Visual Studio 2019 causes crashes for a WPF application

Visual Studio 2019 WPF designer won't display custom controls

Compilation of XAML files (WPF)

Visual studio merge tool with Xaml.cs files

Are there any Visual Studio 2019 extensions for Unity .shader files?

Visual Studio 2019 not picking up CS generated files

Visual Studio community 2019 cannot add cpp files to project