Skip to content

Commit

Permalink
Merge pull request #12473 from workgroupengineering/features/Tools/Pr…
Browse files Browse the repository at this point in the history
…eviewer/AvaloinaVS_Issue324

fix: AvaloniaVS can not resolve resource relative path in Previewer
  • Loading branch information
maxkatz6 authored and grokys committed Oct 2, 2023
1 parent bf12df7 commit 8e44409
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Avalonia.DesignerSupport/DesignWindowLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static Window LoadDesignerWindow(string xaml, string assemblyPath, string
if (assemblyPath != null)
{
if (xamlFileProjectPath == null)
xamlFileProjectPath = "/Designer/Fake.xaml";
xamlFileProjectPath = "/Fake.xaml";
//Fabricate fake Uri
baseUri =
new Uri($"avares://{Path.GetFileNameWithoutExtension(assemblyPath)}{xamlFileProjectPath}");
Expand All @@ -43,7 +43,7 @@ public static Window LoadDesignerWindow(string xaml, string assemblyPath, string
{
LocalAssembly = localAsm,
DesignMode = true,
UseCompiledBindingsByDefault = bool.TryParse(useCompiledBindings, out var parsedValue ) && parsedValue
UseCompiledBindingsByDefault = bool.TryParse(useCompiledBindings, out var parsedValue) && parsedValue
});
var style = loaded as IStyle;
var resources = loaded as ResourceDictionary;
Expand Down Expand Up @@ -90,14 +90,14 @@ public static Window LoadDesignerWindow(string xaml, string assemblyPath, string
};
}
else if (loaded is Application)
control = new TextBlock {Text = "Application can't be previewed in design view"};
control = new TextBlock { Text = "Application can't be previewed in design view" };
else
control = (Control) loaded;
control = (Control)loaded;

window = control as Window;
if (window == null)
{
window = new Window() {Content = (Control)control};
window = new Window() { Content = (Control)control };
}

if (window.PlatformImpl is OffscreenTopLevelImplBase offscreenImpl)
Expand Down

0 comments on commit 8e44409

Please sign in to comment.