Skip to content

Commit

Permalink
Added WebWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
Depechie committed Nov 18, 2017
1 parent d6b1e59 commit 5158178
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OpenHAB.Windows/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
<controls:MapViewWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<DataTemplate x:Key="WebViewTemplate">
<controls:WebViewWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<DataTemplate x:Key="RollershutterTemplate">
<controls:RollershutterWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>
Expand Down Expand Up @@ -84,6 +88,7 @@
SliderTemplate="{StaticResource SliderTemplate}"
SwitchTemplate="{StaticResource SwitchTemplate}"
MapViewTemplate="{StaticResource MapViewTemplate}"
WebViewTemplate="{StaticResource WebViewTemplate}"
TextTemplate="{StaticResource TextItemTemplate}" />
</ResourceDictionary>
</Application.Resources>
Expand Down
7 changes: 7 additions & 0 deletions OpenHAB.Windows/Converters/WidgetTemplateSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ protected override DataTemplate SelectTemplateCore(object item, DependencyObject
return MjpegTemplate;
case WidgetTypeEnum.Mapview:
return MapViewTemplate;
case WidgetTypeEnum.Webview:
return WebViewTemplate;
default:
return FrameTemplate;
}
Expand Down Expand Up @@ -131,6 +133,11 @@ protected override DataTemplate SelectTemplateCore(object item, DependencyObject
/// </summary>
public DataTemplate MapViewTemplate { get; set; }

/// <summary>
/// Gets or sets the template for a web view control
/// </summary>
public DataTemplate WebViewTemplate { get; set; }

private WidgetTypeEnum GetItemViewType(OpenHABWidget openHABWidget)
{
if (openHABWidget.Type.Equals("Switch"))
Expand Down
7 changes: 7 additions & 0 deletions OpenHAB.Windows/OpenHAB.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@
<Compile Include="Controls\TextWidget.xaml.cs">
<DependentUpon>TextWidget.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\WebViewWidget.xaml.cs">
<DependentUpon>WebViewWidget.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\WidgetBase.cs" />
<Compile Include="Converters\BoolToBackgroundColorConverter.cs" />
<Compile Include="Converters\IconToBitmapConverter.cs" />
Expand Down Expand Up @@ -305,6 +308,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\WebViewWidget.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down

0 comments on commit 5158178

Please sign in to comment.