Browse Source

updated rendering code to only run if text field is non-empty

master
Claire 4 years ago
parent
commit
0690513c22
  1. 4
      Adaptive Card Editor UWP.sln
  2. 11
      Adaptive Card Editor UWP/Adaptive Card Editor UWP.csproj
  3. 7
      Adaptive Card Editor UWP/MainPage.xaml.cs

4
Adaptive Card Editor UWP.sln

@ -21,7 +21,9 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E2F5AF78-D3E6-43F9-AF44-F342449B63A5}.Debug|Any CPU.ActiveCfg = Debug|x86
{E2F5AF78-D3E6-43F9-AF44-F342449B63A5}.Debug|Any CPU.ActiveCfg = Debug|x64
{E2F5AF78-D3E6-43F9-AF44-F342449B63A5}.Debug|Any CPU.Build.0 = Debug|x64
{E2F5AF78-D3E6-43F9-AF44-F342449B63A5}.Debug|Any CPU.Deploy.0 = Debug|x64
{E2F5AF78-D3E6-43F9-AF44-F342449B63A5}.Debug|ARM.ActiveCfg = Debug|ARM
{E2F5AF78-D3E6-43F9-AF44-F342449B63A5}.Debug|ARM.Build.0 = Debug|ARM
{E2F5AF78-D3E6-43F9-AF44-F342449B63A5}.Debug|ARM.Deploy.0 = Debug|ARM

11
Adaptive Card Editor UWP/Adaptive Card Editor UWP.csproj

@ -12,7 +12,7 @@
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@ -99,6 +99,7 @@
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>false</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@ -216,6 +217,14 @@
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputPath>bin\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputPath>bin\Release\</OutputPath>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

7
Adaptive Card Editor UWP/MainPage.xaml.cs

@ -142,7 +142,11 @@ namespace Adaptive_Card_Editor_UWP
// clear the grid of existing content
grdCard.Children.Clear();
grdTemplated.Children.Clear();
// render the adaptive card content
if (txtInput.Text.Length > 0)
{
// render an adaptive card
try
{
@ -186,6 +190,9 @@ namespace Adaptive_Card_Editor_UWP
templateOutput.Text = ex.ToString();
grdTemplated.Children.Add(templateOutput);
}
}
// update the XAML layout
grdCard.UpdateLayout();
isRendered = true;

Loading…
Cancel
Save