WindowChromeのSample HelpDesk

WindowChromeのSampleとして作成したHelpDeskシステムをご照会します


6.詳細画面


詳細画面

画面は下記の通りです。

クリックすると拡大します



View

<ccl:CustomChromeWindow 
        x:Class="LivetWPFChromeHelpDesk1.Views.Window20"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell"
        xmlns:ccl="clr-namespace:CustomChromeLibrary;assembly=CustomChromeLibrary"                        
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
        xmlns:l="http://schemas.livet-mvvm.net/2011/wpf"
        xmlns:core="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"      
        xmlns:v="clr-namespace:LivetWPFChromeHelpDesk1.Views"
        xmlns:vm="clr-namespace:LivetWPFChromeHelpDesk1.ViewModels"    
        WindowStartupLocation="CenterScreen"
        Title="Window20" Height="714" Width="1035">

    <shell:WindowChrome.WindowChrome>
        <shell:WindowChrome
            ResizeBorderThickness="6"
            CaptionHeight="43"
            CornerRadius="0,0,0,0"
            GlassFrameThickness="0">
        </shell:WindowChrome>
    </shell:WindowChrome.WindowChrome>

    <Window.Resources>
        <ResourceDictionary>
            <vm:CaptionButtonRectToMarginConverter x:Key="CaptionButtonMarginConverter"/>

            <BooleanToVisibilityConverter x:Key="登録実行BoolToVisibility"/>
            <BooleanToVisibilityConverter x:Key="更新BoolToVisibility"/>
            
            <BooleanToVisibilityConverter x:Key="BoolToVisibility"/>
            
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Resources/Styles2.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    
    <i:Interaction.Triggers>

        <l:InteractionMessageTrigger 
            MessageKey="MessageKeyDSD1" Messenger="{Binding Messenger}">
            <l:TransitionInteractionMessageAction
                WindowType="{x:Type v:DirectorySearchData}" Mode="Modal"/>
        </l:InteractionMessageTrigger>

        <l:InteractionMessageTrigger 
            MessageKey="MessageKeyDSD2" Messenger="{Binding Messenger}">
            <l:TransitionInteractionMessageAction
                WindowType="{x:Type v:DirectorySearchData}" Mode="Modal"/>
        </l:InteractionMessageTrigger>

        <!--WindowのContentRenderedイベントのタイミングでViewModelのInitializeメソッドが呼ばれます-->
        <i:EventTrigger EventName="ContentRendered">
            <l:LivetCallMethodAction MethodTarget="{Binding}" MethodName="Initialize"/>
        </i:EventTrigger>

        <!-- 下記がないと、タスクバーが1つにならない -->
        <i:EventTrigger EventName="Loaded">
            <i:InvokeCommandAction Command="{Binding Path=Loaded}" 
                                   CommandParameter="{Binding Mode=OneTime,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"/>
        </i:EventTrigger>

        <i:EventTrigger EventName="Closing">
            <i:InvokeCommandAction Command="{Binding Path=Closing}"
                                   CommandParameter="{Binding Mode=OneTime,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"/>
        </i:EventTrigger>

        <l:InteractionMessageTrigger MessageKey="Close" Messenger="{Binding Messenger}">
            <l:WindowInteractionMessageAction/>
        </l:InteractionMessageTrigger>

    </i:Interaction.Triggers>

    <!-- Grid-1 -->
    <Grid>

        <!-- WindowChrome Start  -->
        <Border  Grid.RowSpan="2" BorderThickness="3" BorderBrush="Black">
            <Border.Background>
                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="Black" Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
        </Border>

        <Border  BorderThickness="3,3,3,1" BorderBrush="Black" Margin="{Binding Path=CaptionButtonMargin}">
            <Border.Background>
                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="Black" Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
            <!--Window Icon and Title-->
            <StackPanel Orientation="Horizontal" Margin="0" VerticalAlignment="Top">
                <TextBlock Text=" Help Desk" FontFamily="Calibri" FontWeight="Bold" FontSize="26" Foreground="Blue" />
            </StackPanel>
        </Border>
        <ccl:CaptionButtons />
        <!-- WindowChrome End  -->

        <!-- Grid-2 -->
        <!--Content-->
        <Grid Grid.Row="1">
           
            <!-- ★★★ -->
            <TextBox Text="{Binding Path=txt本日}" TextAlignment="Center" 
                    Foreground="White" Background="Black"
                    Height="17" HorizontalAlignment="Center"  Name="txt本日" 
                    VerticalAlignment="Top" Width="81" Margin="809,3,123,0" />
                    
            <TextBlock  Padding="0,4,0,0" TextAlignment="Center" HorizontalAlignment="Left"  VerticalAlignment="Top" 
		        Margin="695,86,0,0" Background="#CCFFFF" Name="txtHyperlink" Height="19" Width="166"> 
                <Hyperlink Command="{Binding OpenWebsiteCommand2}" 
                      CommandParameter="http://www.aa.cyberhome.ne.jp/~bel/">
                  <!--Label-->
                  c# Programing Academy
                </Hyperlink>
            </TextBlock>

            <Button Command="{Binding Path=ReInquiryCommand}" BorderBrush="{x:Null}"  HorizontalAlignment="Left"   VerticalAlignment="Top" Content="再問い合せ" Foreground="White" Height="24" Margin="802,114,0,0" Name="button1" Width="83">
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Style.Triggers>
                            <Trigger Property="UIElement.IsMouseOver" Value="True">
                                <Setter Property="Control.Background" Value="DarkGoldenrod" />
                            </Trigger>
                        </Style.Triggers>
                        <Setter Property="Control.Background" Value="Green" />
                        <Setter Property="Control.Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Control.Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Button.Style>
            </Button>


            <Button  Command="{Binding Path=UpdateDataCommand}" Content="更新" Name="btnUpdate"  Height="24" Width="75" Margin="891,113,0,0"  HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="Black" 
                     Visibility="{Binding Is更新Visible, Converter={StaticResource BoolToVisibility}}">
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Visibility" Value="Visible"/>
                        <Setter Property="Background" Value="YellowGreen"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <TextBox Text="{Binding Path=txtReceiptNumber}"  Height="24"  Width="105" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="114,54,0,0" Name="txtReceiptNumber" VerticalAlignment="Top" Foreground="White"  Background="Black" />

            <Button  Command="{Binding Path=ログインユーザー名貼付Command}" Content="貼付" Name="btnログインユーザー名貼付" Height="24" Width="38" Margin="639,54,0,0"  HorizontalAlignment="Left"  VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>
            <TextBox Text="{Binding Path=txtInquiry}" Width="854" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" AcceptsReturn="True"  TextAlignment="Left" Name="txtInquiry"  HorizontalAlignment="Left"   VerticalAlignment="Top" Margin="114,205,0,0" Foreground="White"  Background="Black"  Height="138" />

            <Button  Command="{Binding Path=InsertDataCommand}" Content="登録実行" Name="btnInsert"  Height="24" Margin="891,54,0,0" 
                    Visibility="{Binding Is登録実行Visible, Converter={StaticResource BoolToVisibility}}"
                    HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="Black" Width="75">
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Visibility" Value="Visible"/>
                        <Setter Property="Background" Value="YellowGreen"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Label   Content="受付番号" Foreground="White" Height="31" HorizontalAlignment="Left" Margin="15,54,0,0" Name="label1" VerticalAlignment="Top" Width="63" />
            <TextBox Text="{Binding Path=txtReceiptDate}" Name="txtReceiptDate" Height="24" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="114,84,0,0" VerticalAlignment="Top" Width="105"  Foreground="White"  Background="Black" />
            <Label   Content="受付年月日時" Foreground="White" Height="31" HorizontalAlignment="Left" Margin="14,84,0,0" Name="label2" VerticalAlignment="Top" Width="93" />
            <TextBox Text="{Binding Path=txtState}" Name="txtState" Height="24" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="114,114,0,0" VerticalAlignment="Top" Width="105"  Foreground="Yellow"  Background="Black" />
            <Label   Content="対応状況" Foreground="White" Height="31" HorizontalAlignment="Left" Margin="15,114,0,0" Name="label3" VerticalAlignment="Top" Width="63" />
            <TextBox Text="{Binding Path=txtCustomer}" Name="txtCustomer" Height="24" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="545,54,0,0" VerticalAlignment="Top" Width="88" Foreground="White"  Background="Black" />
            <Label   Content="質問" Foreground="White" Height="23" HorizontalAlignment="Left" Margin="398,57,0,0" Name="label4" VerticalAlignment="Top" Width="38"  />

            <TextBox Text="{Binding Path=txtProductName}" Name="txtProductName" Height="24" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="114,144,0,0" VerticalAlignment="Top" Width="773" Foreground="White"  Background="Black" />
            <Label   Content="製品名" Foreground="White" Height="31" HorizontalAlignment="Left" Margin="16,144,0,0" Name="label5" VerticalAlignment="Top" Width="63" />

            <Label   Content="タイトル" Foreground="White" Height="31" HorizontalAlignment="Left" Margin="16,174,0,0" Name="label6" VerticalAlignment="Top" Width="92" />
            <TextBox Text="{Binding Path=txtTitle2}" Name="txtTitle2" Height="24" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="114,174,0,0" VerticalAlignment="Top" Width="773" Foreground="White"  Background="Black" />

            <TextBox Text="{Binding Path=txtCompletingDate}" Name="txtCompletingDate" Height="24" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="538,115,0,0" VerticalAlignment="Top" Width="95" Foreground="White"  Background="Black" />
            <Label   Content="完了日" Foreground="White" Height="23" HorizontalAlignment="Left" Margin="494,115,0,0" Name="label7" VerticalAlignment="Top" Width="48" />
            <Label   Content="問い合わせ内容" Foreground="White" Height="43"  HorizontalAlignment="Left" Margin="16,205,0,0" Name="label8" VerticalAlignment="Top" Width="93" />
            <TextBox Text="{Binding Path=txtCorrespondence}" Name="txtCorrespondence" Height="287"  Width="854" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" AcceptsReturn="True"   TextAlignment="Left" Margin="114,356,0,0"  HorizontalAlignment="Left"   VerticalAlignment="Top" Foreground="White"  Background="Black" />
            <Label   Content="対応内容" Foreground="White" Height="31"  Margin="16,356,0,0" Name="label9"  HorizontalAlignment="Left"   VerticalAlignment="Top"  Width="93" />

            <Button Command="{Binding Path=InsertダミーCommand}" Content="ダミー" Name="btnダミー" Height="24" Width="50" Margin="225,54,0,0" HorizontalAlignment="Left"  VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button  Command="{Binding Path=Insert本日Command}" Content="本日" Name="btn本日" Height="24" Width="50" Margin="225,84,0,0"  HorizontalAlignment="Left"  VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button Command="{Binding Path=Insert対応中Command}" Content="対応中" Name="btn対応中"  Height="24" Width="50" Margin="281,114,0,0"  HorizontalAlignment="Left" VerticalAlignment="Top"  BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button Command="{Binding Path=Insert検証中Command}"  Content="検証中" Name="btn検証中"  Height="24" Width="50" Margin="393,114,0,0"  HorizontalAlignment="Left"  VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button Command="{Binding Path=Insert完了済Command}" Content="完了済" Name="btn完了済"  Height="24" Width="50" Margin="337,114,0,0"  HorizontalAlignment="Left"  VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button  Command="{Binding Path=Insert本日2Command}" Content="本日" Name="btn本日2" Height="24" Width="50" Margin="639,113,0,0"  HorizontalAlignment="Left"  VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button  Command="{Binding Path=VisibilityボタンCommand}" Content="Fileボタンを表示" Name="btnFileVisible" Height="24" Width="91" Margin="705,114,0,0"   HorizontalAlignment="Left"  VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>


            <Label Content="回目" Foreground="White" Height="24" HorizontalAlignment="Left" Margin="337,56,0,0" Name="label11" VerticalAlignment="Top" Width="38" />
            <Label Content="日経過" Foreground="White" Height="24" HorizontalAlignment="Left" Margin="337,84,0,0" Name="label12" VerticalAlignment="Top" Width="50" />
            <TextBox Text="{Binding Path=txtNumber}" Name="txtNumber" Height="24" VerticalContentAlignment="Center"  HorizontalAlignment="Left" Margin="281,53,0,0" VerticalAlignment="Top" Width="50" Foreground="White"  Background="Black" />
            <TextBox Text="{Binding Path=txtProgressDay}" Name="txtProgressDay" Height="24" VerticalContentAlignment="Center"  HorizontalAlignment="Left" Margin="281,84,0,0" VerticalAlignment="Top" Width="50" Foreground="White"  Background="Black" />


            <Button Command="{Binding Path=txtMailAddressToClipboardCommand}"  Content="←CB"  Height="24" Width="34" Margin="851,54,0,0"  HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button Command="{Binding Path=txtTitle2ToClipboardCommand}"  Content="←CB"  Height="24" Width="37" Margin="891,174,0,0"  HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button Command="{Binding Path=txtInquiryToClipboardCommand}"  Content="CB↓" Name="btnCB3" Height="24" Width="35" Margin="931,174,0,0"  HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>


            <Button Command="{Binding Path=txtProductName編集Command}"  Content="貼付" Name="btniBOP" Height="24" Width="35" Margin="931,144,0,0"  HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button Command="{Binding Path=txtProductNameToClipboardCommand}"  Content="←CB"  Height="24" Width="37" Margin="891,144,0,0"  HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>
            <Button  Command="{Binding Path=Insert下書Command}" Content="下書" Name="btn下書" Height="24" Width="50" Margin="225,114,0,0"  HorizontalAlignment="Left" VerticalAlignment="Top"  BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="Green"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button Command="{Binding Path=txtInquiryClearCommand}" Content="Clear" Name="btntxtInquiryClear" Height="24" Width="36" Margin="974,319,0,0"   HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="White" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="DarkGreen"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button Command="{Binding Path=GotoDSD1Command}" Content="File" Name="btntxtInquiryFile" Height="24" Width="36" Margin="73,319,0,0"   HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="Black" 
                      Visibility="{Binding IsButtonVisible, Converter={StaticResource BoolToVisibility}}">
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Visibility" Value="Visible"/>
                        <Setter Property="Background" Value="YellowGreen"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <TextBox Text="{Binding Path=txtMailAddress}" VerticalContentAlignment="Center" Background="Black" Foreground="White" Height="24" HorizontalAlignment="Left" Margin="683,54,0,0" Name="txtMailAddress" VerticalAlignment="Top" Width="166" />
            <TextBox Text="{Binding Path=txtCompany}" VerticalContentAlignment="Center" Background="Black" Foreground="White" Height="24" HorizontalAlignment="Left" Margin="444,54,0,0" Name="txtCompany" VerticalAlignment="Top" Width="98" />

            <Label Content="回答" Foreground="White" Height="23" HorizontalAlignment="Left" Margin="398,85,0,0" Name="label10" VerticalAlignment="Top" Width="38" />
            <TextBox Text="{Binding Path=txtCorrespondingCompany}" VerticalContentAlignment="Center" Background="Black" Foreground="White" Height="24" HorizontalAlignment="Left" Margin="444,84,0,0" Name="txtCorrespondingCompany" VerticalAlignment="Top" Width="189" />

<!--        <TextBlock  Text="{Binding Path=txtHyperlink}" Padding="0,4,0,0" TextAlignment="Center" HorizontalAlignment="Left"  VerticalAlignment="Top" Margin="683,90,0,0" Background="#FF1E90FF" Name="txtHyperlink" Height="17" Width="166">           
    				<Hyperlink NavigateUri="https://eservice.fujitsu.com/supportdesk/sdk/sdk?sv=0" RequestNavigate="Hyperlink_RequestNavigate">
        				富士通サポートデスク
    	    		</Hyperlink>
            </TextBlock>
-->
            <!--
            <TextBlock>
                <Hyperlink Command="{Binding OpenSupportWebsiteCommand}" 
                      CommandParameter="http://www.aa.cyberhome.ne.jp/~bel/">
                    <Label Content="富士通サポートデスク" Foreground="White" Height="23" Padding="0,4,0,0"  HorizontalAlignment="Left"  VerticalAlignment="Top" Margin="683,80,0,0" Background="#FF1E90FF" Name="txtHyperlink"  Width="166"/>
                </Hyperlink>
            </TextBlock>
            -->

            <Button Command="{Binding Path=txtCorrespondenceClearCommand}" BorderBrush="{x:Null}" Content="Clear" Foreground="White" Height="24" HorizontalAlignment="Left" Margin="974,619,0,0" Name="btnCorrespondenceClear" VerticalAlignment="Top" Width="36" >
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Style.Triggers>
                            <Trigger Property="UIElement.IsMouseOver" Value="True">
                                <Setter Property="Control.Background" Value="DarkGoldenrod" />
                            </Trigger>
                        </Style.Triggers>
                        <Setter Property="Control.Background" Value="DarkGreen" />
                        <Setter Property="Control.Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Control.Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Button.Style>
            </Button>

            <Button Command="{Binding Path=GotoDSD2Command}" Content="File" Name="btnCorrespondenceFile" Height="24" Width="36" Margin="71,619,0,0"   HorizontalAlignment="Left"   VerticalAlignment="Top" BorderBrush="{x:Null}" Foreground="Black" 
                        Visibility="{Binding IsButtonVisible, Converter={StaticResource BoolToVisibility}}">
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Visibility" Value="Visible"/>
                        <Setter Property="Background" Value="YellowGreen"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="DarkGoldenrod"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>
            <!-- ★★★ -->

        </Grid>
    </Grid>
</ccl:CustomChromeWindow>


ViewModel

using System;

// ObservableCollection
using System.Collections.Generic;
using System.Linq;

//INotifyPropertyChanged
//PropertyChanged
using System.ComponentModel;

//参照設定が必要
//using System.Configuration;

using Livet;
using Livet.Commands;
using Livet.Messaging;
//CloseCommand
using Livet.Messaging.Windows;

//using Livet.Messaging.IO;
//using Livet.EventListeners;

using System.Data.OracleClient;

//ArrayList
using System.Collections;

//XmlReader
using System.Xml;

//XDocument
using System.Xml.Linq;

//XPathDocument
using System.Xml.XPath;

//RequestNavigateEventArgs
//Process.Start
using System.Diagnostics;


//SystemCommands
using Microsoft.Windows.Shell;

//ICommand
using System.Windows.Input;

//MessageBox
using System.Windows;

// ListCollectionView
using System.Windows.Data;

//Encoding
using System.Text;

using LivetWPFChromeHelpDesk1.Models;
using LivetWPFChromeHelpDesk1.Views;
using LivetWPFChromeHelpDesk1.ViewModels;

namespace LivetWPFChromeHelpDesk1.ViewModels
{
    class ViewModel20 : ViewModel
    {
        #region 変更通知プロパティ
        //-----------------------------------------------
        public string txtMessage { get; set; }
        public string txt本日 { get; set; }
        public bool IsEnabled { get; set; }

        public string txtCorrespondingCompany { get; set; }
        //
        private string _txtReceiptNumber;
        public string txtReceiptNumber
        {
            get { return _txtReceiptNumber; }
            set
            {
                if (_txtReceiptNumber != value)
                {
                    _txtReceiptNumber = value;
                    RaisePropertyChanged(&quot;txtReceiptNumber&quot;);
                }
            }
        }
        //
        private string _txtNumber;
        public string txtNumber
        {
            get { return _txtNumber; }
            set
            {
                if (_txtNumber != value)
                {
                    _txtNumber = value;
                    RaisePropertyChanged(&quot;txtNumber&quot;);
                }
            }
        }
        //
        private string _txtReceiptDate;
        public string txtReceiptDate
        {
            get { return _txtReceiptDate; }
            set
            {
                if (_txtReceiptDate != value)
                {
                    _txtReceiptDate = value;
                    RaisePropertyChanged(&quot;txtReceiptDate&quot;);
                }
            }
        }
        //
        //■
        private string _txtCompletingDate;
        public string txtCompletingDate
        {
            get { return _txtCompletingDate; }
            set
            {
                if (_txtCompletingDate != value)
                {
                    _txtCompletingDate = value;
                    RaisePropertyChanged(&quot;txtCompletingDate&quot;);
                }
            }
        }
        //
        private string _txtState;
        public string txtState
        {
            get { return _txtState; }
            set
            {
                if (_txtState != value)
                {
                    _txtState = value;
                    RaisePropertyChanged(&quot;txtState&quot;);
                }
            }
        }
        //
        private string _txtCompany;
        public string txtCompany
        {
            get { return _txtCompany; }
            set
            {
                if (_txtCompany != value)
                {
                    _txtCompany = value;
                    RaisePropertyChanged(&quot;txtCompany&quot;);
                }
            }
        }
        //
        private string _txtCustomer;
        public string txtCustomer
        {
            get { return _txtCustomer; }
            set
            {
                if (_txtCustomer != value)
                {
                    _txtCustomer = value;
                    RaisePropertyChanged(&quot;txtCustomer&quot;);
                }
            }
        }
        //
        private string _txtMailAddress;
        public string txtMailAddress
        {
            get { return _txtMailAddress; }
            set
            {
                if (_txtMailAddress != value)
                {
                    _txtMailAddress = value;
                    RaisePropertyChanged(&quot;txtMailAddress&quot;);
                }
            }
        }
        //
        private string _txtProductName;
        public string txtProductName
        {
            get { return _txtProductName; }
            set
            {
                if (_txtProductName != value)
                {
                    _txtProductName = value;
                    RaisePropertyChanged(&quot;txtProductName&quot;);
                }
            }
        }
        //
        private string _txtTitle2;
        public string txtTitle2
        {
            get { return _txtTitle2; }
            set
            {
                if (_txtTitle2 != value)
                {
                    _txtTitle2 = value;
                    RaisePropertyChanged(&quot;txtTitle2&quot;);
                }
            }
        }
        //
        private string _txtInquiry;
        public string txtInquiry 
        {
            get { return _txtInquiry; }
            set
            {
                if (_txtInquiry != value)
                {
                    _txtInquiry = value;
                    RaisePropertyChanged(&quot;txtInquiry&quot;);
                }
            }
        }
        //
        private string _txtCorrespondence;
        public string txtCorrespondence
        {
            get { return _txtCorrespondence; }
            set
            {
                if (_txtCorrespondence != value)
                {
                    _txtCorrespondence = value;
                    RaisePropertyChanged(&quot;txtCorrespondence&quot;);
                }
            }
        }
        //
        private string _txtSearchInquiry;
        public string txtSearchInquiry
        {
            get { return _txtSearchInquiry; }
            set
            {
                if (_txtSearchInquiry != value)
                {
                    _txtSearchInquiry = value;
                    RaisePropertyChanged(&quot;txtSearchInquiry&quot;);
                }
            }
        }
        //
        private string _txtProgressDay;
        public string txtProgressDay
        {
            get { return _txtProgressDay; }
            set
            {
                if (_txtProgressDay != value)
                {
                    _txtProgressDay = value;
                    RaisePropertyChanged(&quot;txtProgressDay&quot;);
                }
            }
        }
        //
        private string _txt件数;
        public string txt件数
        {
            get { return _txt件数; }
            set
            {
                if (_txt件数 != value)
                {
                    _txt件数 = value;
                    RaisePropertyChanged(&quot;txt件数&quot;);
                }
            }
        }
        //
        private string _txtPath;
        public string txtPath
        {
            get { return _txtPath; }
            set
            {
                if (_txtPath != value)
                {
                    _txtPath = value;
                    RaisePropertyChanged(&quot;txtPath&quot;);
                }
            }
        }
        //

        #endregion

        #region Argument変更通知プロパティ
        private Argument _argument;
        public Argument argument
        {
            get { return _argument; }
            set
            {
                if (_argument == value)
                    return;
                _argument = value;
                RaisePropertyChanged(&quot;argument&quot;);
            }
        }
        #endregion
        
        string GstrReceiptnumber = &quot;&quot;;
        string GstrNumber = &quot;&quot;;
        string GstrTitle = &quot;&quot;;
        string GstrAction = &quot;&quot;;
        string GstrPath = &quot;&quot;;
        //
        string strヘルプデスク質問 = @&quot;D:\ヘルプデスク質問\&quot;;
        string strヘルプデスク回答 = @&quot;D:\ヘルプデスク回答\&quot;;
        static ArrayList Gfiles;

        Window win = null;
        public ViewModel20(Argument argument)
        {
            Loaded = new Livet.Commands.ListenerCommand&lt;Window&gt;((w) =&gt;
            {
                if (NeedHideOwner &amp;&amp; w.Owner != null &amp;&amp; w.Owner.Visibility == Visibility.Visible)
                {
                    win = w;
                    //w.Owner.Hide();
                }
            });

            Closing = new Livet.Commands.ListenerCommand&lt;Window&gt;((w) =&gt;
            {
                if (NeedHideOwner &amp;&amp; w.Owner != null)
                {
                    w.Owner.Show();
                }
            });

            txt本日 = Convert.ToString(DateTime.Today.ToShortDateString());
            GstrReceiptnumber = argument.ReceiptNumber;
            GstrNumber = argument.Number;
            GstrTitle = argument.Title;
            GstrAction = argument.Action;
            GstrPath = argument.XMLPath;

            if (GstrReceiptnumber != &quot;&quot;)
            {
                //照会
                Is登録実行Visible = false;
                Is更新Visible = true;
                Read();
            }
            else
            {
                //新規登録
                Is登録実行Visible = true;
                Is更新Visible = false;

            }
            //Initialize()では表示されない
            txt本日 = Convert.ToString(DateTime.Today.ToShortDateString());

            if (txtState == &quot;対応中&quot; || txtState == &quot;検証中&quot;)
            {
                //経過日数
                //FileButtonVisuble();
                //DateTime値に変換する文字列
                string s1 = txtReceiptDate + &quot;:00&quot;;
                //文字列をDateTime値に変換する
                DateTime oldDate = DateTime.Parse(s1);
                //DateTime oldDate = new DateTime(2014, 3, 1);
                DateTime newDate = DateTime.Now;
                // Difference in days, hours, and minutes.
                TimeSpan ts = newDate - oldDate;
                // Difference in days.
                int differenceInDays = ts.Days;
                txtProgressDay = differenceInDays.ToString();
            }
        }
        public bool NeedHideOwner { get; set; }
        public ICommand Loaded { get; private set; }
        public ICommand Closing { get; private set; }

        public void Initialize()
        {
            if (win != null) win.Owner.Hide();

            if (GstrAction == &quot;更新&quot;)
            {
                FileButtonVisuble();
            }
        }

        #region OpenWebsiteCommand2
        ListenerCommand<string> _OpenWebsiteCommand2;
        public ListenerCommand<string> OpenWebsiteCommand2
        {
            get
            {
                if (_OpenWebsiteCommand2 == null)
                {
                    _OpenWebsiteCommand2 = new ListenerCommand<string>(OpenWebsite, () => true);
                }
                return _OpenWebsiteCommand2;
            }
        }
        
        void OpenWebsite(string str)
        {
            if (str == null)
            {
                Messenger.Raise(new InformationMessage("Cancel", "Error", MessageBoxImage.Error, "Info"));
                return;
            }

            if (str != null && str.Length > 0)
        #region FileButtonVisuble
        private void FileButtonVisuble()
        {
            string strファイル名で検索 = txtReceiptNumber.Trim() + &quot;*.*&quot;.Trim(); ;
            string strFolder = &quot;&quot;;
            string[] stFilePathes = { &quot;&quot; };
            
            strFolder = @strヘルプデスク質問;
            strFolder = strFolder.Trim();
            
            try
            {
                stFilePathes = GetFilesMostDeep(strFolder, &quot;*&quot; + strファイル名で検索);
                if (stFilePathes.Length != 0)
                {
                    IsButtonVisible = true;
                }

            }
            catch
            {
            }
            //-------------------------------------------------------------------------------------------
            strFolder = strFolder = @strヘルプデスク回答;
            strFolder = strFolder.Trim();

            stFilePathes = null;

            try
            {
                stFilePathes = GetFilesMostDeep(strFolder, &quot;*&quot; + strファイル名で検索);
                if (stFilePathes.Length != 0)
                {
                    IsButtonVisible = true;
                }

            }
            catch
            {
            }
        }
        #endregion

        #region GetFilesMostDeep
        public static string[] GetFilesMostDeep(string stRootPath, string stPattern)
        {
            System.Collections.Specialized.StringCollection hStringCollection = (
                new System.Collections.Specialized.StringCollection()
                );

            // このディレクトリ内のすべてのファイルを検索する
            foreach (string stFilePath in System.IO.Directory.GetFiles(stRootPath, stPattern))
            {
                hStringCollection.Add(stFilePath);
            }

            // このディレクトリ内のすべてのサブディレクトリを検索する (再帰)
            foreach (string stDirPath in System.IO.Directory.GetDirectories(stRootPath))
            {
                string[] stFilePathes = GetFilesMostDeep(stDirPath, stPattern);

                // 条件に合致したファイルがあった場合は、ArrayList に加える
                if (stFilePathes != null)
                {
                    hStringCollection.AddRange(stFilePathes);
                }
            }

            // StringCollection を 1 次元の String 配列にして返す
            string[] stReturns = new string[hStringCollection.Count];
            hStringCollection.CopyTo(stReturns, 0);

            Gfiles = new ArrayList(hStringCollection);
            return stReturns;
        }
        #endregion

        private bool _IsButtonVisible;
        public bool IsButtonVisible
        {
            get { return _IsButtonVisible; }
            set
            {
                _IsButtonVisible = value;
                RaisePropertyChanged(&quot;IsButtonVisible&quot;);
            }
        }
        #region VisibilityボタンCommand
        private ViewModelCommand _VisibilityボタンCommand;
        public ViewModelCommand VisibilityボタンCommand
        {
            get
            {
                if (_VisibilityボタンCommand == null)
                {
                    _VisibilityボタンCommand = new ViewModelCommand(VisibilityButton);
                }
                return _VisibilityボタンCommand;
            }
        }
        public void VisibilityButton()
        {
            //----------------------
            //IsButtonVisible = true;
            IsButtonVisible = !IsButtonVisible;
            //----------------------
        }

        //-------------------------------------------------
        private bool _Is登録実行Visible;
        public bool Is登録実行Visible
        {
            get { return _Is登録実行Visible; }
            set
            {
                _Is登録実行Visible = value;
                RaisePropertyChanged(&quot;Is登録実行Visible&quot;);
            }
        }

        //-------------------------------------------------
        private bool _Is更新Visible;
        public bool Is更新Visible
        {
            get { return _Is更新Visible; }
            set
            {
                _Is更新Visible = value;
                RaisePropertyChanged(&quot;Is更新Visible&quot;);
            }
        }
        /*
         登録実行ボタンと更新ボタンの可視は、他のボタンのClickコマンドで決めるのではないのて
         VisibilityボタンCommandのようなCommandは不要
        */
        #endregion

        /*
        // https://social.msdn.microsoft.com/Forums/vstudio/en-US/b64387a6-ff0f-4048-b9af-65e801d1f1ea/command-hyperlink?forum=wpf
        public ICommand OpenSupportWebsiteCommand
        {
            get
            {
                if (mOpenSupportWebsiteCommand == null)
                {
                    mOpenSupportWebsiteCommand = new RelayCommand&lt;object&gt;(OpenSupportWebsite);
                }

                return mOpenSupportWebsiteCommand;
            }
        }


        private RelayCommand&lt;object&gt; mOpenSupportWebsiteCommand;

        private void OpenSupportWebsite(object url)
        {
            System.Diagnostics.Process.Start(url as string);
        }
        */


        #region Read
        private void Read()
        {
            XDocument xmlDoc = XDocument.Load(GstrPath);
            try
            {
                var tweets = (from entry in xmlDoc.Descendants(&quot;helpdesk&quot;)
                             .Where(node =&gt; (string)node.Attribute(&quot;receiptnumber&quot;) == GstrReceiptnumber)
                             .Where(node =&gt; (string)node.Attribute(&quot;number&quot;) == GstrNumber)
                             .Where(node =&gt; (string)node.Element(&quot;title&quot;) == GstrTitle)
                              select new
                              {
                                  CorrespondingCompany = entry.Attribute(&quot;correspondingcompany&quot;).Value,
                                  ReceiptNumber = entry.Attribute(&quot;receiptnumber&quot;).Value,
                                  Number = entry.Attribute(&quot;number&quot;).Value,
                                  ReceiptDate = entry.Attribute(&quot;receiptdate&quot;).Value,
                                  Completingdate = entry.Attribute(&quot;completingdate&quot;).Value,
                                  State = entry.Attribute(&quot;state&quot;).Value,
                                  Company = entry.Element(&quot;company&quot;).Value,
                                  Customer = entry.Element(&quot;customer&quot;).Value,
                                  MailAddress = entry.Element(&quot;mailaddress&quot;).Value,
                                  ProductName = entry.Element(&quot;productname&quot;).Value,
                                  Title = entry.Element(&quot;title&quot;).Value,
                                  Inquiry = entry.Element(&quot;inquiry&quot;).Value,
                                  Correspondence = entry.Element(&quot;correspondence&quot;).Value,
                              }
                             );

                //string str = &quot;&quot;;

                //listBox1.Items.Clear();

                foreach (var k in tweets)
                {
                    txtCorrespondingCompany = k.CorrespondingCompany;
                    txtReceiptNumber = k.ReceiptNumber;
                    txtNumber = k.Number;
                    txtReceiptDate = k.ReceiptDate;
                    txtCompletingDate = k.Completingdate;
                    txtState = k.State;
                    txtCompany = k.Company;
                    txtCustomer = k.Customer;
                    txtMailAddress = k.MailAddress;
                    txtProductName = k.ProductName;
                    txtTitle2 = k.Title;

                    txtInquiry = k.Inquiry;
                    txtInquiry = txtInquiry.Replace(&quot;\n&quot;, &quot;\r\n&quot;);

                    txtCorrespondence = k.Correspondence;
                    txtCorrespondence = txtCorrespondence.Replace(&quot;\n&quot;, &quot;\r\n&quot;);
                    break;
                }
                //return;
                //-----------------------------------
                tweets = null;
                xmlDoc = null;
                //GC.Collect();
                //
                //GC.WaitForPendingFinalizers();
                //-----------------------------------
            }
            catch
            {
            }


        }
        #endregion

        #region InsertダミーCommand
        private ViewModelCommand _InsertダミーCommand;
        public ViewModelCommand InsertダミーCommand
        {
            get
            {
                if (_InsertダミーCommand == null)
                {
                    _InsertダミーCommand = new ViewModelCommand(Insertダミー);
                }
                return _InsertダミーCommand;
            }
        }
        public void Insertダミー()
        {
            if ((txtReceiptNumber != null) &amp;&amp; (txtReceiptNumber.Length != 0))
            {
                System.Windows.Forms.MessageBox.Show(&quot;受付番号が未入力でないので、貼付は出来ません。&quot;);
            }
            else
            {
                string str = DateTime.Today.ToString(&quot;d&quot;);
                str = str.Substring(1, 3) + &quot;-&quot; + str.Substring(5, 2) + str.Substring(8, 2) + &quot;-0000&quot;;
                txtReceiptNumber = str;
            }
        }
        #endregion

        #region Insert本日Command
        private ViewModelCommand _Insert本日Command;
        public ViewModelCommand Insert本日Command
        {
            get
            {
                if (_Insert本日Command == null)
                {
                    _Insert本日Command = new ViewModelCommand(Insert本日);
                }
                return _Insert本日Command;
            }
        }
        public void Insert本日()
        {
            //txtReceiptDate = Convert.ToString(DateTime.Today.ToString(&quot;d&quot;));
            txtReceiptDate = Convert.ToString(DateTime.Now.ToString(&quot;g&quot;));
        }
        #endregion

        #region Insert下書Command
        private ViewModelCommand _Insert下書Command;
        public ViewModelCommand Insert下書Command
        {
            get
            {
                if (_Insert下書Command == null)
                {
                    _Insert下書Command = new ViewModelCommand(Insert下書);
                }
                return _Insert下書Command;
            }
        }
        public void Insert下書()
        {
            txtState = &quot;下書&quot;;
        }
        #endregion

        #region Insert対応中Command
        private ViewModelCommand _Insert対応中Command;
        public ViewModelCommand Insert対応中Command
        {
            get
            {
                if (_Insert対応中Command == null)
                {
                    _Insert対応中Command = new ViewModelCommand(Insert対応中);
                }
                return _Insert対応中Command;
            }
        }
        public void Insert対応中()
        {
            txtState = &quot;対応中&quot;;
        }
        #endregion

        #region Insert検証中Command
        private ViewModelCommand _Insert検証中Command;
        public ViewModelCommand Insert検証中Command
        {
            get
            {
                if (_Insert検証中Command == null)
                {
                    _Insert検証中Command = new ViewModelCommand(Insert検証中);
                }
                return _Insert検証中Command;
            }
        }
        public void Insert検証中()
        {
            txtState = &quot;検証中&quot;;
        }
        #endregion

        #region Insert完了済Command
        private ViewModelCommand _Insert完了済Command;
        public ViewModelCommand Insert完了済Command
        {
            get
            {
                if (_Insert完了済Command == null)
                {
                    _Insert完了済Command = new ViewModelCommand(Insert完了済);
                }
                return _Insert完了済Command;
            }
        }
        public void Insert完了済()
        {
            txtState = &quot;完了済&quot;;
        }
        #endregion

        #region ログインユーザー名貼付Command
        private ViewModelCommand _ログインユーザー名貼付Command;
        public ViewModelCommand ログインユーザー名貼付Command
        {
            get
            {
                if (_ログインユーザー名貼付Command == null)
                {
                    _ログインユーザー名貼付Command = new ViewModelCommand(ログインユーザー名貼付);
                }
                return _ログインユーザー名貼付Command;
            }
        }
        private void ログインユーザー名貼付()
        {
            txtCompany = &quot;豊洲システム開発&quot;;
            txtCorrespondingCompany = &quot;C# Programing Academy&quot;;

            if (txtNumber == &quot;&quot;)
            {
                txtNumber = &quot;1&quot;;
            }
            string[] array = new string[3];
            array = ログインユーザー名獲得();
            txtCompany = array[0];            //名前
            txtCustomer = array[1];            //姓名
            txtMailAddress = array[2];         //メールアドレス
        }
       
        private string[] ログインユーザー名獲得()
        {
            using (OracleConnection con = new OracleConnection())
            {
                // ユーザー名(ログイン名)の取得
                string uName = Environment.UserName;
                uName = uName.ToUpper();
                // 社員マスターと照合
                string[] array = new string[3];
                //
                try
                {
                    con.ConnectionString = &quot;User Id=beluran; Password=beluran; Data Source=beluran;Pooling=false;&quot;;
                    con.Open();
                    //
                    string CmdString = &quot;SELECT K.会社名 ,S.社員名,S.社員姓名, S.メールアドレス FROM 社員マスター S &quot; +
                                        &quot; LEFT JOIN 会社マスター K &quot; +
                                        &quot; ON S.会社コード = K.会社コード &quot; +
                                        &quot; WHERE S.SYS_DEL_FLG  = &apos;0&apos; AND S.ログインコード = &apos;&quot; + uName + &quot;&apos;&quot;;

                    //
                    OracleCommand oracmd = new OracleCommand(CmdString, con);
                    OracleDataReader reader = oracmd.ExecuteReader();

                    while (reader.Read() == true)
                    {
                        array[0] = reader[&quot;会社名&quot;].ToString();
                        array[1] = reader[&quot;社員姓名&quot;].ToString();
                        array[2] = reader[&quot;メールアドレス&quot;].ToString();
                    }
                }
                catch
                {
                }
                finally
                {

                }
                return array;
            }
        }

        //***********************************************
        private string[] ログインユーザー名獲得2()
		{
			
					 // ユーザー名(ログイン名)の取得
                			string uName = Environment.UserName;
                			uName = uName.ToUpper();
                			// 社員マスターと照合
                			string[] array = new string[3];

					int iERR = 0;
					string cmdstr = &quot;&quot;;
					using (OracleConnection con = new OracleConnection())
					{
						con.ConnectionString = &quot;User Id=beluran; Password=beluran; Data Source=beluran;Pooling=false;&quot;;
						con.Open();

                        //using (OracleTransaction tx = con.BeginTransaction(IsolationLevel.Serializable)) 
                        //{
							try 
							{
	

	                    					string CmdString = &quot;SELECT K.会社名 ,S.社員名,S.社員姓名, S.メールアドレス FROM 社員マスター S &quot; +
                                        			&quot; LEFT JOIN 会社マスター K &quot; +
                                        			&quot; ON S.会社コード = K.会社コード &quot; +
                                        			&quot; WHERE S.SYS_DEL_FLG  = &apos;0&apos; AND S.ログインコード = &apos;&quot; + uName + &quot;&apos;&quot;;
				
                    						OracleCommand oracmd = new OracleCommand(CmdString, con);
                    						OracleDataReader reader = oracmd.ExecuteReader();

                    						while (reader.Read() == true)
                    						{
                        						array[0] = reader[&quot;会社名&quot;].ToString();
                        						array[1] = reader[&quot;社員姓名&quot;].ToString();
                        						array[2] = reader[&quot;メールアドレス&quot;].ToString();
                    						}

								//*** Tran ***
								//tx.Commit();

							}		
							catch (OracleException ex)
							{
								iERR = 1;
							}

							finally
							{
							}
						}	//OracleTransaction tx

                    //}	//OracleTransaction tx
                    return array;
		}
        #endregion

        #region Insert本日2Command
        private ViewModelCommand _Insert本日2Command;
        public ViewModelCommand Insert本日2Command
        {
            get
            {
                if (_Insert本日2Command == null)
                {
                    _Insert本日2Command = new ViewModelCommand(Insert本日2);
                }
                return _Insert本日2Command;
            }
        }
        public void Insert本日2()
        {
            txtCompletingDate = Convert.ToString(DateTime.Today.ToString(&quot;d&quot;));
        }
        #endregion

        #region txtProductName編集Command
        private ViewModelCommand _txtProductName編集Command;
        public ViewModelCommand txtProductName編集Command
        {
            get
            {
                if (_txtProductName編集Command == null)
                {
                    _txtProductName編集Command = new ViewModelCommand(txtProductName編集);
                }
                return _txtProductName編集Command;
            }
        }
        public void txtProductName編集()
        {
            txtProductName = &quot;Microsot C# WPF WindowChromeプログラミング&quot;;
        }
        #endregion


        #region ReInquiryCommand
        private ViewModelCommand _ReInquiryCommand;
        public ViewModelCommand ReInquiryCommand
        {
            get
            {
                if (_ReInquiryCommand == null)
                {
                    _ReInquiryCommand = new ViewModelCommand(ReInquiry2);
                }
                return _ReInquiryCommand;
            }
        }
        public void ReInquiry2()
        {
            //DialogResult.Yesでエラー
            //if (System.Windows.Forms.MessageBox.Show(&quot;再問い合せは現在の内容で回数を1つアップさせて新しいデータを作成して一覧画面へ戻ります。再問い合せをしないで終了しますか?&quot;, &quot;再問い合せの確認&quot;, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            //{
            //    this.Owner.Show();
            //    this.Close();
            //}
            //★System.Windows.MessageBox
            MessageBoxResult result = System.Windows.MessageBox.Show(&quot;再問い合せは現在の内容で回数を1つアップさせて新しいデータを作成して一覧画面へ戻ります。再問い合せをしますか?&quot;, &quot;再問い合せの確認&quot;, MessageBoxButton.YesNo, MessageBoxImage.Question);
            if (result == MessageBoxResult.No)
            {
                return;
            }

            //---
            if (GstrAction == &quot;新規登録&quot;)
            {
                //System.Windows.Forms.MessageBox.Show(&quot;「新規登録」作業の途中です。入力が完了していたら、「登録実行」をクリックして下さい。&quot;);
                //return;
            }
            else
            {
                //----------------------------------------
                if (txtReceiptDate == &quot;&quot;)
                {
                    System.Windows.Forms.MessageBox.Show(&quot;受付番号がブランクです。&quot;);
                    return;
                }
                //----------------------------------------
                if (Util.IsNumber(txtNumber))
                {
                    txtNumber = Convert.ToString(Convert.ToInt32(txtNumber) + 1);
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show(&quot;回数が数値ではありません。&quot;);
                    return;
                }
                //----------------------------------------
                str再問い合せ = &quot;再&quot;;
                //txtState = &quot;対応中&quot;;
                txtReceiptDate = DateTime.Now.ToString(&quot;g&quot;);
                txtCompletingDate = &quot;&quot;;

                //----------------------------------
                //Copy &amp; Pasteを反映させる為に入れる
                //----------------------------------
                //System.Windows.Forms.Application.DoEvents();


   //             InsertSupportDesk();
                CheckInsertData();

                if (win != null) win.Owner.Show();
                win.Close();
                
            }
        }
        #endregion

        #region InsertDataCommand
        private ViewModelCommand _InsertDataCommand;
        public ViewModelCommand InsertDataCommand
        {
            get
            {
                if (_InsertDataCommand == null)
                {
                    _InsertDataCommand = new ViewModelCommand(CheckInsertData);
                }
                return _InsertDataCommand;
            }
        }
        public void CheckInsertData()
        {
            if ((txtReceiptNumber != null) &amp;&amp; (txtReceiptNumber.Length != 0))
            {
                if (txtReceiptNumber.Length != 13)
                {
                    System.Windows.Forms.MessageBox.Show(&quot;「受付番号の桁数が違います。&quot;);
                    return;
                }
            }
            else{
                System.Windows.Forms.MessageBox.Show(&quot;受付番号は必須です。決まっていなかったりダミーをクリックして下さい。&quot;);
                return;
            }

            //-----------------------------------------
            if ((txtCompany != null) &amp;&amp; (txtCompany.Length != 0))
            {
            }
            else
            {
                txtCompany = &quot;豊洲システム開発&quot;;
            }
            if ((txtCorrespondingCompany != null) &amp;&amp; (txtCorrespondingCompany.Length != 0))
            {
            }
            else
            {
                txtCorrespondingCompany = &quot;C# Programing Academy&quot;;
            }
            if ((txtNumber != null) &amp;&amp; (txtNumber.Length != 0))
            {
            }
            else
            {
                txtNumber = &quot;1&quot;;
            }
            if ((txtState != null) &amp;&amp; (txtState.Length != 0))
            {
            }
            else
            {
                System.Windows.Forms.MessageBox.Show(&quot;対応状況は必須入力です。&quot;);
                return;
            }
            if ((txtTitle2 != null) &amp;&amp; (txtTitle2.Length != 0))
            {
            }
            else
            {
                System.Windows.Forms.MessageBox.Show(&quot;タイトルは必須入力です。&quot;);
                return;
            }
            InsertData();
        }

        string str再問い合せ = &quot;&quot;;






        public void InsertData()
        {
            //-----------------------------------------
            //Util.バックアップサポートデスク質問と回答();
            //-----------------------------------------
            string strTitle = &quot;&quot;;
            if (str再問い合せ == &quot;再&quot;)
            {
                if (txtTitle2.IndexOf(&quot;■&quot;) == -1)
                {
                    strTitle = txtTitle2 + &quot; ■■&quot;;
                }
                else
                {
                    strTitle = txtTitle2;
                }
            }
            else
            {
                strTitle = txtTitle2;
            }
            if ((txtCompletingDate != null) &amp;&amp; (txtCompletingDate.Length != 0))
            {
            }
            else
            {
                txtCompletingDate = &quot;&quot;;
            }

            var xelm = XElement.Load(GstrPath);
            var p = new XElement(&quot;helpdesk&quot;,
                      new XAttribute(&quot;correspondingcompany&quot;, txtCorrespondingCompany),
                        new XAttribute(&quot;receiptnumber&quot;, txtReceiptNumber),
                        new XAttribute(&quot;number&quot;, txtNumber),
                        new XAttribute(&quot;receiptdate&quot;, txtReceiptDate),
                        new XAttribute(&quot;completingdate&quot;,txtCompletingDate),
                        new XAttribute(&quot;state&quot;, txtState),
                        new XElement(&quot;company&quot;, txtCompany),
                        new XElement(&quot;customer&quot;, txtCustomer),
                        new XElement(&quot;mailaddress&quot;, txtMailAddress),
                        new XElement(&quot;productname&quot;, txtProductName),
                        new XElement(&quot;title&quot;, strTitle),
                        new XElement(&quot;inquiry&quot;, txtInquiry),
                        new XElement(&quot;correspondence&quot;, txtCorrespondence)
                        );
            xelm.Add(p);
            xelm.Save(GstrPath);
/*
            XDocument xdoc2 = XDocument.Load(GstrPath);
            XElement e2 = new XElement(&quot;helpdesk&quot;,
            xdoc2.Root.Add(e2);
            xdoc2.Save(GstrPath);
*/

            str再問い合せ = &quot;&quot;;
        }
        #endregion

        #region UpdateDataCommand
        private ViewModelCommand _UpdateDataCommand;
        public ViewModelCommand UpdateDataCommand
        {
            get
            {
                if (_UpdateDataCommand == null)
                {
                    _UpdateDataCommand = new ViewModelCommand(CheckUpdateData);
                }
                return _UpdateDataCommand;
            }
        }
        public void CheckUpdateData()
        {
            if (txtReceiptNumber.Length != 13)
            {
                System.Windows.Forms.MessageBox.Show(&quot;「受付番号の桁数が違います。&quot;);
                 return;
            }
            //-----------------------------------------
            if ((txtCompany != null) &amp;&amp; (txtCompany.Length != 0))
            {
                
            }
            else
            {
                txtCompany = &quot;豊洲システム開発&quot;;
            }
            if ((txtCorrespondingCompany != null) &amp;&amp; (txtCorrespondingCompany.Length != 0))
            {
            }
            else
            {
                txtCorrespondingCompany = &quot;C# Programing Academy&quot;;
            }
            if ((txtNumber != null) &amp;&amp; (txtNumber.Length != 0))
            {
            }
            else
            {
                txtNumber = &quot;1&quot;;
            }
            //-----------------------------------------
            //Util.バックアップサポートデスク質問と回答();
            //-----------------------------------------
            UpdateData();
        }

        public void UpdateData()
        {
            //XDocument xmlDoc = XDocument.Load(@&quot;HelpDesk.xml&quot;);
            //XDocument xmlDoc = XDocument.Load(path);

            var xelm = XElement.Load(GstrPath);

            var tweets = from entry in xelm.Descendants(&quot;helpdesk&quot;)
                             //where entry.Attribute(&quot;receiptnumber&quot;).Value == GstrReceiptnumber
                             //where entry.Attribute(&quot;number&quot;).Value == GstrNumber

               //照会したキーで再度検索する
               .Where(node =&gt; (string)node.Attribute(&quot;receiptnumber&quot;) == GstrReceiptnumber)
               .Where(node =&gt; (string)node.Attribute(&quot;number&quot;) == GstrNumber)
               .Where(node =&gt; (string)node.Element(&quot;title&quot;) == GstrTitle)

                         //.Where(node =&gt; (string)node.Attribute(&quot;receiptnumber&quot;) == txtReceiptNumber)
                         //.Where(node =&gt; (string)node.Attribute(&quot;number&quot;) == txtNumber)
                         //.Where(node =&gt; (string)node.Element(&quot;title&quot;) == txtTitle2)
                select entry;

            foreach (var help in tweets)
            {
                help.Attribute(&quot;correspondingcompany&quot;).Value = txtCorrespondingCompany;
                help.Attribute(&quot;receiptnumber&quot;).Value = txtReceiptNumber;
                help.Attribute(&quot;number&quot;).Value = txtNumber;
                help.Attribute(&quot;receiptdate&quot;).Value = txtReceiptDate;
                help.Attribute(&quot;completingdate&quot;).Value = txtCompletingDate;
                help.Attribute(&quot;state&quot;).Value = txtState;
                help.Element(&quot;company&quot;).Value = txtCompany;
           help.Element(&quot;customer&quot;).Value = txtCustomer;
                help.Element(&quot;mailaddress&quot;).Value = txtMailAddress;
                help.Element(&quot;productname&quot;).Value = txtProductName;
                help.Element(&quot;title&quot;).Value = txtTitle2;
                help.Element(&quot;inquiry&quot;).Value = txtInquiry;
                help.Element(&quot;correspondence&quot;).Value = txtCorrespondence;
                xelm.Save(GstrPath);
                //
                GstrReceiptnumber = txtReceiptNumber;
                GstrNumber = txtNumber;
                GstrTitle = txtTitle2;
            }

        }
        #endregion

        #region txtMailAddressToClipboardCommand
        private ViewModelCommand _txtMailAddressToClipboardCommand;
        public ViewModelCommand txtMailAddressToClipboardCommand
        {
            get
            {
                if (_txtMailAddressToClipboardCommand == null)
                {
                    _txtMailAddressToClipboardCommand = new ViewModelCommand(txtMailAddressToClipboard);
                }
                return _txtMailAddressToClipboardCommand;
            }
        }
        public void txtMailAddressToClipboard()
        {
            System.Windows.Forms.Clipboard.SetText(txtMailAddress);
        }
        #endregion

        #region txtProductNameToClipboardCommand
        private ViewModelCommand _txtProductNameToClipboardCommand;
        public ViewModelCommand txtProductNameToClipboardCommand
        {
            get
            {
                if (_txtProductNameToClipboardCommand == null)
                {
                    _txtProductNameToClipboardCommand = new ViewModelCommand(txtProductNameToClipboard);
                }
                return _txtProductNameToClipboardCommand;
            }
        }
        public void txtProductNameToClipboard()
        {
            System.Windows.Forms.Clipboard.SetText(txtProductName);
        }
        #endregion

        #region txtTitle2ToClipboardCommand
        private ViewModelCommand _txtTitle2ToClipboardCommand;
        public ViewModelCommand txtTitle2ToClipboardCommand
        {
            get
            {
                if (_txtTitle2ToClipboardCommand == null)
                {
                    _txtTitle2ToClipboardCommand = new ViewModelCommand(txtTitle2ToClipboard);
                }
                return _txtTitle2ToClipboardCommand;
            }
        }
        public void txtTitle2ToClipboard()
        {
            System.Windows.Forms.Clipboard.SetText(txtTitle2);
        }
        #endregion

        #region txtInquiryToClipboardCommand
        private ViewModelCommand _txtInquiryToClipboardCommand;
        public ViewModelCommand txtInquiryToClipboardCommand
        {
            get
            {
                if (_txtInquiryToClipboardCommand == null)
                {
                    _txtInquiryToClipboardCommand = new ViewModelCommand(txtInquiryToClipboard);
                }
                return _txtInquiryToClipboardCommand;
            }
        }
        public void txtInquiryToClipboard()
        {
            System.Windows.Forms.Clipboard.SetText(txtInquiry);
        }
        #endregion

        #region txtInquiryClearCommand
        private ViewModelCommand _txtInquiryClearCommand;
        public ViewModelCommand txtInquiryClearCommand
        {
            get
            {
                if (_txtInquiryClearCommand == null)
                {
                    _txtInquiryClearCommand = new ViewModelCommand(txtInquiryClear);
                }
                return _txtInquiryClearCommand;
            }
        }
        public void txtInquiryClear()
        {
            txtInquiry = &quot;&quot;;
        }
        #endregion

        #region txtCorrespondenceClearCommand
        private ViewModelCommand _txtCorrespondenceClearCommand;
        public ViewModelCommand txtCorrespondenceClearCommand
        {
            get
            {
                if (_txtCorrespondenceClearCommand == null)
                {
                    _txtCorrespondenceClearCommand = new ViewModelCommand(txtCorrespondenceClear);
                }
                return _txtCorrespondenceClearCommand;
            }
        }
        public void txtCorrespondenceClear()
        {
            txtCorrespondence = &quot;&quot;;
        }
        #endregion

        #region GotoCommandDSD
        //----------------------------------------------------------------
        public ViewModelCommand GotoDSD1Command
        {
            get { return new Livet.Commands.ViewModelCommand(GotoDSD1); }
        }
        public void GotoDSD1()
        {
            Argument argument = new Argument();
            argument.ReceiptNumber = txtReceiptNumber;
            argument.Number = txtNumber;
            argument.Title = txtTitle2;
            argument.Action = &quot;&quot;;
            argument.InquiryCorrespondence = &quot;Inquiry&quot;;
            argument.XMLPath = GstrPath;

            Messenger.Raise(new TransitionMessage(new DirectorySearchViewModel(argument) { NeedHideOwner = true }, &quot;MessageKeyDSD1&quot;));
        }
        //----------------------------------------------------------------
        public ViewModelCommand GotoDSD2Command
        {
            get { return new Livet.Commands.ViewModelCommand(GotoDSD2); }
        }
        public void GotoDSD2()
        {
            Argument argument = new Argument();
            argument.ReceiptNumber = txtReceiptNumber;
            argument.Number = txtNumber;
            argument.Title = txtTitle2;
            argument.Action = &quot;&quot;;
            argument.InquiryCorrespondence = &quot;Correspondence&quot;;
            argument.XMLPath = GstrPath;

            Messenger.Raise(new TransitionMessage(new DirectorySearchViewModel(argument) { NeedHideOwner = true }, &quot;MessageKeyDSD2&quot;));
        }
        //----------------------------------------------------------------
        #endregion

        #region CloseCommand
        private ViewModelCommand _CloseCommand;
        public ViewModelCommand CloseCommand
        {
            get
            {
                if (_CloseCommand == null)
                {
                    _CloseCommand = new ViewModelCommand(Close);
                }
                return _CloseCommand;
            }
        }
        public void Close()
        {
            var window = Application.Current.Windows.OfType&lt;Window&gt;().SingleOrDefault((w) =&gt; w.IsActive);
            window.Close();
        }
        #endregion
    }
}