Skip to content

Commit

Permalink
Add browser control
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Ludewig committed May 18, 2019
1 parent 3d0ae5f commit 1b4a212
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
1 change: 1 addition & 0 deletions ControlCatalog/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"/>
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Default.xaml"/>
<StyleInclude Source="resm:CefGlue.Avalonia.AvaloniaCefBrowser.xaml?assembly=CefGlue.Avalonia"/>
<Style Selector="TextBlock.h1">
<Setter Property="FontSize" Value="{DynamicResource FontSizeLarge}"/>
<Setter Property="FontWeight" Value="Medium"/>
Expand Down
3 changes: 3 additions & 0 deletions ControlCatalog/ControlCatalog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<PackageReference Include="Avalonia" Version="0.8.1-cibuild0002425-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.8.1-cibuild0002425-beta" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.8.1-cibuild0002425-beta" />
<PackageReference Include="VitalElement.CefGlue.Core" Version="0.9.0-build32-alpha" />
<PackageReference Include="VitalElement.CefGlue.Core.Avalonia" Version="0.9.0-build32-alpha" />
<PackageReference Include="VitalElement.CefGlue.Core.Win-x64" Version="0.9.0-build32-alpha" />

</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion ControlCatalog/MainView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<TabItem Header="ListBox"><pages:ListBoxPage/></TabItem>
<TabItem Header="Menu"><pages:MenuPage/></TabItem>
<TabItem Header="Notifications"><pages:NotificationsPage/></TabItem>
<TabItem Header="NumericUpDown"><pages:NumericUpDownPage/></TabItem>
<TabItem Header="NumericUpDown"><pages:NumericUpDownPage/></TabItem>
<TabItem Header="ProgressBar"><pages:ProgressBarPage/></TabItem>
<TabItem Header="RadioButton"><pages:RadioButtonPage/></TabItem>
<TabItem Header="Slider"><pages:SliderPage/></TabItem>
Expand Down
11 changes: 10 additions & 1 deletion ControlCatalog/MainView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ public MainView()
Header = "Screens",
Content = new ScreenPage()
});

tabItems.Add(new TabItem()
{
Header = "3rd Party Controls",
IsHitTestVisible = false
});
tabItems.Add(new TabItem()
{
Header = "Browser",
Content = new BrowserPage()
});
}

var light = new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
Expand Down
6 changes: 6 additions & 0 deletions ControlCatalog/Pages/BrowserPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="clr-namespace:CefGlue.Avalonia;assembly=CefGlue.Avalonia"
x:Class="ControlCatalog.Pages.BrowserPage">
<b:AvaloniaCefBrowser StartUrl="http://www.bing.com"></b:AvaloniaCefBrowser>
</UserControl>
18 changes: 18 additions & 0 deletions ControlCatalog/Pages/BrowserPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace ControlCatalog.Pages
{
public class BrowserPage : UserControl
{
public BrowserPage()
{
this.InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}

0 comments on commit 1b4a212

Please sign in to comment.