aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/AddItemDialog.xaml
blob: c529eabe0795db19d468362c6478c07c96a79151 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<UserControl x:Class="Tango.MachineStudio.ThreadExtensions.Views.AddItemDialog"
             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:vm="clr-namespace:Tango.MachineStudio.ThreadExtensions.ViewModels"
             xmlns:global="clr-namespace:Tango.MachineStudio.ThreadExtensions"
             xmlns:local="clr-namespace:Tango.MachineStudio.ThreadExtensions.Views"
             mc:Ignorable="d" 
             d:DesignHeight="650" d:DesignWidth="800" Background="{StaticResource Dialog.Background}"  Foreground="{StaticResource MainWindow.Foreground}" d:DataContext="{d:DesignInstance Type=vm:AddItemDialogVM, IsDesignTimeCreatable=False}" DataContext="{x:Static  global:ViewModelLocator.AddItemDialogVM}">
    <Grid>
        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
            <TextBlock Text="New Item Name" VerticalAlignment="Center" Margin="0 20 0 0" FontSize="20"></TextBlock>
            <TextBox Name="ItemlName" TextAlignment="Left" FontSize="21" MinWidth="250" Margin="0 20 10 10" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" ></TextBox>
            <StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
                <Button Name="AddItem" Command="{Binding SaveCommand}" Width="Auto" HorizontalAlignment="Right" Margin="0 40 10 10">SAVE</Button>
                <Button  Command="{Binding CancelCommand}" Width="Auto" HorizontalAlignment="Right" Margin="0 40 10 10">CANCEL</Button>
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>
>{ private Action<WorkItem> _onApprove; private Action<WorkItem> _onDecline; public TeamFoundationServiceExtendedClient TFSClient { get; set; } public RelayCommand<WorkItem> ApproveCommand { get; set; } public RelayCommand<WorkItem> DeclineCommand { get; set; } private bool _isAvailable; public bool IsAvailable { get { return _isAvailable; } set { _isAvailable = value; RaisePropertyChangedAuto(); } } public ResolvedIssuesViewVM() : base() { IsAvailable = true; ApproveCommand = new RelayCommand<WorkItem>(ApproveIssue); DeclineCommand = new RelayCommand<WorkItem>(DeclineIssue); } public ResolvedIssuesViewVM(TeamFoundationServiceExtendedClient tfsClient, Action<WorkItem> onApprove, Action<WorkItem> onDecline) : this() { TFSClient = tfsClient; _onApprove = onApprove; _onDecline = onDecline; } private void DeclineIssue(WorkItem workItem) { _onDecline(workItem); } private void ApproveIssue(WorkItem workItem) { _onApprove(workItem); } public void Close() { Accept(); } } }