forked from NewLifeX/XCoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10ebb93
commit c0bb8db
Showing
18 changed files
with
226 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Media; | ||
using HandyControl.Controls; | ||
using XCoderWpf.Models; | ||
using XCoderWpf.ViewModels; | ||
using XCoderWpf.Views; | ||
|
||
namespace XCoderWpf.Common | ||
{ | ||
public class MainMenu | ||
{ | ||
private readonly SolidColorBrush _solidColorBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#7F4463")); | ||
private readonly FontFamily _yhFontFamily = new FontFamily("微软雅黑"); | ||
private readonly FontFamily _fontFamily = new FontFamily(new Uri("pack://application:,,,/"), "./Resources/#iconfont"); | ||
private readonly Thickness _margin = new Thickness(10, 0, 0, 0); | ||
private readonly SideMenu _sizeMenu; | ||
private readonly MainWindowViewModel _mainViewViewModel; | ||
|
||
public MainMenu(MainWindowViewModel vm, SideMenu sizeMenu) { _mainViewViewModel = vm; _sizeMenu = sizeMenu; } | ||
|
||
public void InitializeSystemMenu() | ||
{ | ||
var menus = _mainViewViewModel.MainMenuList; | ||
var lvl1Data = menus.Where(x => x.Pid == x.Id).ToList(); | ||
|
||
_sizeMenu.Items.Clear(); | ||
var lvl1MenuList = lvl1Data.Select(x => GetSideMenuItem(x, _yhFontFamily)).ToArray(); | ||
_sizeMenu.Items.AddRange(lvl1MenuList); | ||
|
||
for (var index = 0; index < lvl1Data.Count; index++) | ||
lvl1MenuList[index].Items.AddRange(menus.Where(x => x.Pid == lvl1Data[index].Id && x.Pid != x.Id).Select(x => GetSideMenuItem(x))); | ||
} | ||
|
||
private SideMenuItem GetSideMenuItem(MainMenuModel item, FontFamily fontFamily = null) | ||
{ | ||
var side = new SideMenuItem | ||
{ | ||
Header = item.Header, | ||
Foreground = _solidColorBrush, | ||
Icon = new TextBlock { Text = item.IconFont, FontFamily = _fontFamily, Margin = _margin, Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(item.BackColor)) }, | ||
Tag = item.Tag, | ||
//Command = _mainViewViewModel.SelectCmd, | ||
//CommandParameter = item.Tag, | ||
}; | ||
if (fontFamily == null) return side; | ||
side.FontFamily = _yhFontFamily; | ||
side.FontSize = 20; | ||
return side; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
namespace XCoderWpf.Models | ||
{ | ||
public class MainMenuModel | ||
{ | ||
public String IconFont { get; set; } | ||
|
||
public String Header { get; set; } | ||
|
||
public String BackColor { get; set; } | ||
|
||
public String Tag { get; set; } | ||
public int Id { get; set; } | ||
public int Pid { get; set; } | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Prism.Mvvm; | ||
|
||
namespace XCoderWpf.ViewModels | ||
{ | ||
public class DataBasePublishViewModel : BindableBase | ||
{ | ||
private IList<string> _datalist; | ||
public IList<string> DataList | ||
{ | ||
get { return _datalist; } | ||
set { SetProperty(ref _datalist, value); } | ||
} | ||
public DataBasePublishViewModel() | ||
{ | ||
DataList = new ObservableCollection<string> | ||
{ | ||
"mssql111", | ||
"mssql112", | ||
"mssql113", | ||
"mssql114", | ||
"mssql115", | ||
"mssql1117", | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,63 @@ | ||
<UserControl x:Class="XCoderWpf.Views.DataBasePublish" | ||
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:XCoderWpf.Views" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800"> | ||
<Grid> | ||
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center"> | ||
<TextBlock Style="{StaticResource TextBlockLarge}">ahahahahahaha非常好</TextBlock> | ||
<Button Margin="10" Style="{StaticResource ButtonDanger}"> 11111111111111111</Button> | ||
<Button Margin="10" Style="{StaticResource ButtonSuccess}">2222222222 2221</Button> | ||
<Button Margin="10" Style="{StaticResource ButtonWarning}">2222222222 2221</Button> | ||
xmlns:prism="http://prismlibrary.com/" | ||
xmlns:hc="https://handyorg.github.io/handycontrol" | ||
prism:ViewModelLocator.AutoWireViewModel="True"> | ||
<Grid Background="{DynamicResource BackgroundBrush}"> | ||
<Border Background="{DynamicResource RegionBrush}" Effect="{StaticResource EffectShadow4}" CornerRadius="16" Margin="10"> | ||
<Grid > | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition/> | ||
<ColumnDefinition Width="2*"/> | ||
</Grid.ColumnDefinitions> | ||
|
||
</StackPanel> | ||
<Border Effect="{StaticResource EffectShadow4}" Background="{DynamicResource DarkDefaultBrush}" CornerRadius="16,0,0,16"> | ||
|
||
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Vertical"> | ||
<hc:ComboBox Margin="30,30,30,0" AutoComplete="True" ShowClearButton="True" ItemsSource="{Binding DataList}" IsEditable="True" hc:InfoElement.Placeholder="请选择" hc:TitleElement.Title="数据库连接"/> | ||
|
||
<TextBlock Margin="40,80,0,0" Foreground="White"> | ||
<Bold>提示</Bold>path | ||
</TextBlock> | ||
|
||
<TextBlock FontWeight="DemiBold" FontSize="22" Foreground="White" Margin="40"> | ||
2种用法<LineBreak/> | ||
|
||
</TextBlock> | ||
<TextBlock FontWeight="Medium" Margin="40,0" Foreground="{DynamicResource ThirdlyTextBrush}"> | ||
1.连接数据库,得到数据表信息<LineBreak/> | ||
2.导入模型,得到数据表信息<LineBreak/> | ||
|
||
</TextBlock> | ||
<Image Margin="40,280" Width="46" HorizontalAlignment="Left" Source="{StaticResource Sagittarius}"/> | ||
</StackPanel> | ||
</Border> | ||
|
||
<Border Effect="{StaticResource EffectShadow4}" Grid.Column="1" Background="{DynamicResource RegionBrush}" CornerRadius="0,16,16,0"> | ||
<StackPanel HorizontalAlignment="Center"> | ||
<Image Margin="30" Source="{StaticResource Table}" Width="128"/> | ||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal"> | ||
<Image Width="24" Source="{StaticResource Graduation}"/> | ||
<TextBlock Margin="5,0" Text="Create an account" FontWeight="Bold" FontSize="14"/> | ||
</StackPanel> | ||
<Button Width="350" Margin="0,40"> | ||
<StackPanel Orientation="Horizontal"> | ||
<Image Margin="10,0" Source="{StaticResource Google}"/> | ||
|
||
<TextBlock Text="Sign up with Google"/> | ||
</StackPanel> | ||
</Button> | ||
<hc:Divider Width="350" Content="OR"/> | ||
<TextBox Style="{StaticResource TextBoxExtend}" hc:TitleElement.Title="Your email" Text="[email protected]"/> | ||
<PasswordBox Style="{StaticResource PasswordBoxExtend}" hc:TitleElement.Title="Set password"/> | ||
<Button Content="Sign up" Style="{DynamicResource ButtonViolet}" Margin="0,30" Width="350"/> | ||
<TextBlock Margin="0,50,0,0" HorizontalAlignment="Center" > | ||
Already have an account? <Button Margin="-4,-10" Content="Sign in" BorderThickness="0" Foreground="Purple" FontWeight="DemiBold" /> | ||
</TextBlock> | ||
</StackPanel> | ||
</Border> | ||
</Grid> | ||
</Border> | ||
</Grid> | ||
</UserControl> |
Oops, something went wrong.