Родитель
9cd658c65c
Коммит
db86b6aa2e
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="XAMLator.SampleApp.LabelView">
|
||||
<ContentView.Content>
|
||||
<Label Text="{Binding Description}"/>
|
||||
</ContentView.Content>
|
||||
</ContentView>
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace XAMLator.SampleApp
|
||||
{
|
||||
public partial class LabelView : ContentView
|
||||
{
|
||||
public LabelView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:cv="clr-namespace:XAMLator.SampleApp"
|
||||
x:Class="XAMLator.SampleApp.PageWithNestedView">
|
||||
<ContentPage.Content>
|
||||
<cv:LabelView/>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace XAMLator.SampleApp
|
||||
{
|
||||
public partial class PageWithNestedView : ContentPage
|
||||
{
|
||||
public PageWithNestedView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,6 +20,14 @@
|
|||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)LabelView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)PageWithNestedView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)App.xaml.cs">
|
||||
|
@ -34,5 +42,11 @@
|
|||
<Compile Include="$(MSBuildThisFileDirectory)PageWithCSS.xaml.cs">
|
||||
<DependentUpon>PageWithCSS.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)LabelView.xaml.cs">
|
||||
<DependentUpon>LabelView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)PageWithNestedView.xaml.cs">
|
||||
<DependentUpon>PageWithNestedView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -172,6 +172,14 @@ namespace XAMLator.Client
|
|||
/// <value><c>true</c> if needs rebuild; otherwise, <c>false</c>.</value>
|
||||
public bool NeedsRebuild { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the xaml resource identifier.
|
||||
/// </summary>
|
||||
/// <value>The xaml resource identifier.</value>
|
||||
// FIXME: This must be retrieved using the XamlResourceIdAttribute in the autogenerated
|
||||
// code behind
|
||||
public string XamlResourceId => xamlFilePath != null ? Path.GetFileName(xamlFilePath) : null;
|
||||
|
||||
string CurrentClassName => counter == 0 ? ClassName : $"{ClassName}{counter}";
|
||||
|
||||
string CurrentFullNamespace
|
||||
|
@ -252,6 +260,7 @@ namespace XAMLator.Client
|
|||
FindSymbol();
|
||||
FillName();
|
||||
FillNamespace();
|
||||
FillSources();
|
||||
NeedsClassInitialization = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ namespace XAMLator.Client
|
|||
NeedsRebuild = classDecl.NeedsRebuild,
|
||||
NewTypeExpression = classDecl.NewInstanceExpression,
|
||||
Xaml = classDecl.Xaml,
|
||||
XamlResourceName = classDecl.XamlResourceId,
|
||||
StyleSheets = classDecl.StyleSheets
|
||||
};
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace XAMLator
|
|||
public string Xaml;
|
||||
public Dictionary<string, string> StyleSheets;
|
||||
public bool NeedsRebuild;
|
||||
public string XamlResourceName;
|
||||
}
|
||||
|
||||
public class EvalMessage : INotifyPropertyChanged
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace XAMLator.Server
|
|||
static string LoadResource(AssemblyName assemblyName, string name)
|
||||
{
|
||||
Log.Information($"Resolving resource {name}");
|
||||
if (name.EndsWith(".xaml"))
|
||||
if (name == currentEvalRequest.XamlResourceName)
|
||||
{
|
||||
return currentEvalRequest.Xaml;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче