下班 还有一些小问题 1.0版本就可以发布了
This commit is contained in:
57
Control/UserControls/Backlog/BacklogControl.xaml
Normal file
57
Control/UserControls/Backlog/BacklogControl.xaml
Normal file
@@ -0,0 +1,57 @@
|
||||
<UserControl x:Class="GeekDesk.Control.UserControls.Backlog.BacklogControl"
|
||||
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:GeekDesk.Control.UserControls.PannelCard"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
mc:Ignorable="d"
|
||||
Background="AliceBlue"
|
||||
>
|
||||
|
||||
<hc:SimplePanel Margin="20">
|
||||
<Grid>
|
||||
<DataGrid x:Name="BacklogList"
|
||||
HeadersVisibility="All"
|
||||
AutoGenerateColumns="False"
|
||||
ItemsSource="{Binding}"
|
||||
IsReadOnly="True"
|
||||
Initialized="DataGridMenu_Initialized"
|
||||
>
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu x:Name="Menu" Width="120">
|
||||
<MenuItem Header="详情" Click="DetailMenu_Click"/>
|
||||
<MenuItem Header="删除" Click="DeleteMenu_Click"/>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource DataGridRowStyle}">
|
||||
<EventSetter Event="MouseRightButtonUp" Handler="DataGridRow_MouseRightButtonUp" />
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell" BasedOn="{StaticResource DataGridCellStyle}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource DataGridColumnHeaderStyle}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
<DataGrid.Background>
|
||||
<SolidColorBrush Color="AliceBlue"/>
|
||||
</DataGrid.Background>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="120" Binding="{Binding Title}" Header="待办任务"/>
|
||||
<DataGridTextColumn Width="210" Binding="{Binding Msg}" Header="待办详情"/>
|
||||
<DataGridTextColumn Width="147" Binding="{Binding ExeTime}" Header="待办时间"/>
|
||||
<DataGridTextColumn Width="147" Binding="{Binding DoneTime}" Header="完成时间"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<StackPanel hc:Growl.GrowlParent="True" hc:Growl.Token="DeleteConfirm" VerticalAlignment="Center" Margin="0,10,10,50"/>
|
||||
</Grid>
|
||||
</hc:SimplePanel>
|
||||
</UserControl>
|
||||
72
Control/UserControls/Backlog/BacklogControl.xaml.cs
Normal file
72
Control/UserControls/Backlog/BacklogControl.xaml.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using GeekDesk.Control.Windows;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Controls;
|
||||
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 GeekDesk.Control.UserControls.Backlog
|
||||
{
|
||||
/// <summary>
|
||||
/// BacklogControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class BacklogControl : UserControl
|
||||
{
|
||||
private AppData appData = MainWindow.appData;
|
||||
public BacklogControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void DeleteMenu_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BacklogInfo info = BacklogList.SelectedItem as BacklogInfo;
|
||||
Growl.Ask("确认删除吗?", isConfirmed =>
|
||||
{
|
||||
if (isConfirmed)
|
||||
{
|
||||
appData.ExeBacklogList.Remove(info);
|
||||
CommonCode.SaveAppData(MainWindow.appData);
|
||||
}
|
||||
return true;
|
||||
}, "DeleteConfirm");
|
||||
}
|
||||
|
||||
private void DetailMenu_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BacklogInfo info = BacklogList.SelectedItem as BacklogInfo;
|
||||
BacklogInfoWindow.ShowDetail(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 禁用设置按钮右键菜单
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void DataGridMenu_Initialized(object sender, EventArgs e)
|
||||
{
|
||||
BacklogList.ContextMenu = null;
|
||||
}
|
||||
|
||||
|
||||
private void DataGridRow_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
BacklogList.SelectedIndex = ((DataGridRow)sender).GetIndex();
|
||||
Menu.IsOpen = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user