Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button Style Update #7

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,6 @@ FakesAssemblies/
# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
ModelManifest.xml
*.nupkg
/.vs
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# WPF.Bootstrap
A Bootstrap Theme for WPF

[![NuGet Version and Downloads count](https://buildstats.info/nuget/Bootstrap.Wpf)](https://www.nuget.org/packages/Bootstrap.Wpf)

## How to Use

`Install-Package Bootstrap.Wpf`


Put the following code in your App.xaml or MainWindow.xaml or any other window which use the resourse, for example, in `App.xaml`

<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WPF.Bootstrap;component/Themes/Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

Now you can use the controls, for example:

<bootstrap:BootstrapPanel Margin="10" Type="Default" Header="Default Panel">
<TextBlock>content</TextBlock>
<bootstrap:BootstrapPanel.Footer>
<TextBlock>footer</TextBlock>
</bootstrap:BootstrapPanel.Footer>
</bootstrap:BootstrapPanel>

Remember to add `xmlns:bootstrap="http://github.com/scheshan/bootstrap"`

## Use Wpf.Bootstrap in a WPF User Control Library (.dll) project

If the solution contains one .exe project and several other WPF User Control Library (.dll) projects, the Wpf.Bootstrap package should be added to both the .dll projects and the exe project, even if the .exe project does not use Wpf.Bootstrap directly.

## Project History

This project originally is a fork from [scheshan/WPF.Bootstrap](https://github.com/scheshan/WPF.Bootstrap). This project uses a different nuget pakcage id: `Bootstrap.Wpf`. (Could you see the difference?)

## Revision History

### v0.0.5:

Added TabInPanel control. (previous TabPanel is renamed to TabNavi)

![TabPanel](./TabPanel.png)

### v0.0.4:

Added TabPanel:

You can use TabPanel alone with as a navigation control. You don't need to bind it to tab content.

### v0.0.3:

1)Remove dependency of Microsoft.windows.shell

After the removal of above dependencies, the dialog/window stype will be managed by the OS (Win7 or Win10). Thereafter this project will mainly focus on the style/theme of content of window or controls.
Binary file added TabPanel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions WPF.Bootstrap.Demo/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<ReactiveUI />
</Weavers>
12 changes: 8 additions & 4 deletions WPF.Bootstrap.Demo/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<wpf:Dialog
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="http://www.scheshan.com/bootstrap"
x:Class="WPF.Bootstrap.Demo.MainWindow"
xmlns:wpf="http://github.com/scheshan/bootstrap"
xmlns:view="clr-namespace:WPF.Bootstrap.Demo.Views"
Title="Demo" Height="700" Width="800">

Expand All @@ -24,5 +22,11 @@
<TabItem Header="List">
<view:List/>
</TabItem>
<TabItem Header="TabNavi">
<view:TabNaviControl></view:TabNaviControl>
</TabItem>
<TabItem Header="TabInPanel">
<view:TabPanelControl></view:TabPanelControl>
</TabItem>
</TabControl>
</wpf:Dialog>
</Window>
68 changes: 30 additions & 38 deletions WPF.Bootstrap.Demo/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 10 additions & 14 deletions WPF.Bootstrap.Demo/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions WPF.Bootstrap.Demo/ViewModels/TabInPanelViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ReactiveUI;

namespace WPF.Bootstrap.Demo.ViewModels
{
public class TabInPanelViewModel : ReactiveObject
{
public TabInPanelViewModel()
{
TabItems = new ReactiveList<TabItemViewModel>();

TabItems.Add(new TabItemViewModel("test"));
TabItems.Add(new TabItemViewModel("test 2"));
}

public ReactiveList<TabItemViewModel> TabItems { get; set; }
}
}
21 changes: 21 additions & 0 deletions WPF.Bootstrap.Demo/ViewModels/TabItemViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;

namespace WPF.Bootstrap.Demo.ViewModels
{
public class TabItemViewModel : ReactiveObject
{
public TabItemViewModel(string header)
{
Header = header;
}

[Reactive]
public string Header { get; set; }
}
}
2 changes: 1 addition & 1 deletion WPF.Bootstrap.Demo/Views/List.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Class="WPF.Bootstrap.Demo.Views.List"
x:Class="WPF.Bootstrap.Demo.Views.List"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<Grid>
Expand Down
8 changes: 4 additions & 4 deletions WPF.Bootstrap.Demo/Views/Panel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:bootstrap="http://github.com/scheshan/bootstrap"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:bootstrap="clr-namespace:WPF.Bootstrap.Controls;assembly=WPF.Bootstrap"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<Grid>
Expand All @@ -19,8 +19,8 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<bootstrap:BootstrapPanel Margin="10" Type="Default" Header="Default Panel">

<bootstrap:BootstrapPanel Margin="10" Type="Default" Header="Default Panel">
<TextBlock>content</TextBlock>
<bootstrap:BootstrapPanel.Footer>
<TextBlock>footer</TextBlock>
Expand Down
20 changes: 20 additions & 0 deletions WPF.Bootstrap.Demo/Views/TabNaviControl.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<UserControl x:Class="WPF.Bootstrap.Demo.Views.TabNaviControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WPF.Bootstrap.Demo.Views"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<TabControl TabStripPlacement="Left" Style="{DynamicResource TabNaviStyle}"
Width="200"
VerticalAlignment="Center" HorizontalAlignment="Center">
<TabItem Header="1"></TabItem>
<TabItem Header="1 asdf "></TabItem>
<TabItem Header="1 asd asd adsf"></TabItem>
<TabItem Header="1 incalctive"></TabItem>
<TabItem Header="1 active"></TabItem>
</TabControl>
</Grid>
</UserControl>
28 changes: 28 additions & 0 deletions WPF.Bootstrap.Demo/Views/TabNaviControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WPF.Bootstrap.Demo.Views
{
/// <summary>
/// Interaction logic for TabPanelControl.xaml
/// </summary>
public partial class TabNaviControl : UserControl
{
public TabNaviControl()
{
InitializeComponent();
}
}
}
16 changes: 16 additions & 0 deletions WPF.Bootstrap.Demo/Views/TabPanelControl.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<UserControl x:Class="WPF.Bootstrap.Demo.Views.TabPanelControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:controls="clr-namespace:WPF.Bootstrap.Controls;assembly=WPF.Bootstrap"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
</UserControl.Resources>
<Grid>
<controls:TabInPanel TabStripPlacement="Top" Style="{DynamicResource TabInPanelStyle}" PanelBackground="{DynamicResource BgPrimary}"
ItemsSource="{Binding TabItems}">
</controls:TabInPanel>
</Grid>
</UserControl>
Loading