3

Excel アドイン、c#、.net 4.0、Windows 7、リボン アドインにはリボン タブ、複数のリボン ボタンがあり、1 つのリボンをクリックすると、アドインは複数の Web サービス呼び出しを送信し、タブ、ツリービューにデータを提供するウィンドウがポップアップします、gridview など。treeview、gridview のデータは、Web サービス呼び出しから取り込まれます。昨日まで特定のエンドユーザーのためにすべてが機能していました。彼がボタンをクリックすると、ウィンドウが表示されたように見えますが、Excel の背後にあるようなもので、フォーカスできませんでした。また、タブ、ツリービュー、グリッドビューなどがない空白です。すべての Web サービス呼び出しが正しく返されることを確認しました。ユーザーは Windows 7、Excel 2010 (32 ビット) を使用しています。何が原因なのかわかりません。助けてください。これは私の WPF ウィンドウです。ありがとう

<Window x:Class="MIMICWPFLib.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:sharedC="clr-namespace:MIMICShared.Converter;assembly=MstarCommodityShared" 
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" 
    xmlns:dxt="clr-namespace:DevExpress.Xpf.Utils.Themes;assembly=DevExpress.Xpf.Core.v11.2"
    xmlns:Controls="clr-namespace:MIMICWPFLib.Controls"
    Title="{Binding Title}"        
Height="600" Width="850" Top="223" Left="164" ResizeMode="CanResize" Closing="WindowClosing"
WindowStyle="ToolWindow">
<Window.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="MainWindowResources.xaml" />
            <ResourceDictionary Source="Controls/BizzySpinner.xaml" />
        </ResourceDictionary.MergedDictionaries>
        <sharedC:BooleanToHiddenVisibility x:Key="boolToVis"/>
        <sharedC:NegativeBooleanToHiddenVisibiltyConverter x:Key="negativeBoolToVis" />
        <DataTemplate x:Key="{dxt:DXTabControlThemeKey ResourceKey=BackgroundTemplate, ThemeName=Office2007Silver}">
            <Border BorderBrush="#FF828790" BorderThickness="1" Background="#E5E3E3"/>
        </DataTemplate>
        <DataTemplate x:Key="{dxt:DXTabControlThemeKey ResourceKey=BackgroundTemplate}">
            <Border BorderBrush="#FF828790" BorderThickness="1" Background="White"/>
        </DataTemplate>
        <ControlTemplate x:Key="{dxt:DXTabControlThemeKey ResourceKey=TopLayoutTemplate}" TargetType="{x:Type dx:DXTabControl}">
            <Grid>
                <KeyboardNavigation.TabNavigation>Local</KeyboardNavigation.TabNavigation>

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid Grid.Row="0" Margin="0,2,0,0" x:Name="tabHeadersPanel">
                    <KeyboardNavigation.TabIndex>1</KeyboardNavigation.TabIndex>
                    <KeyboardNavigation.DirectionalNavigation>Cycle</KeyboardNavigation.DirectionalNavigation>
                    <KeyboardNavigation.TabNavigation>Once</KeyboardNavigation.TabNavigation>
                    <Panel.ZIndex>1</Panel.ZIndex>

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <dx:ClippedContainer Grid.Column="0" UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
                                 Style="{DynamicResource {dxt:DXTabControlInternalThemeKey ResourceKey=ClippedContainerTopLayoutStyle}}">
                        <dx:TabPanelContainer x:Name="panelContainer" Style="{DynamicResource {dxt:DXTabControlInternalThemeKey ResourceKey=PanelContainerTopLayoutStyle}}">
                            <dx:TabPanelContainer.Resources>
                                <Storyboard x:Key="ScrollStoryboard">
                                    <DoubleAnimation Storyboard.TargetName="ItemsPanelTranslate" 
                                         Storyboard.TargetProperty="X" Duration="0:0:0.4" To="0">
                                        <DoubleAnimation.EasingFunction>
                                            <ExponentialEase EasingMode="EaseOut" Exponent="0" />
                                        </DoubleAnimation.EasingFunction>
                                    </DoubleAnimation>
                                </Storyboard>
                            </dx:TabPanelContainer.Resources>
                            <ItemsPresenter>
                                <ItemsPresenter.RenderTransform>
                                    <TranslateTransform x:Name="ItemsPanelTranslate" />
                                </ItemsPresenter.RenderTransform>
                            </ItemsPresenter>
                        </dx:TabPanelContainer>
                    </dx:ClippedContainer>
                    <dx:TabControlScrollButton x:Name="PrevButton" Grid.Column="1" Style="{DynamicResource {dxt:DXTabControlThemeKey ResourceKey=PrevButtonStyle}}" 
                                       Margin="{DynamicResource {dxt:DXTabControlInternalThemeKey ResourceKey=ComponentsSpaceForHorizontalLayouts}}" />
                    <dx:TabControlScrollButton x:Name="NextButton" Grid.Column="2" Style="{DynamicResource {dxt:DXTabControlThemeKey ResourceKey=NextButtonStyle}}" 
                                       Margin="{DynamicResource {dxt:DXTabControlInternalThemeKey ResourceKey=ComponentsSpaceForHorizontalLayouts}}" />
                    <!--<dx:HeaderMenu Grid.Column="3" x:Name="HeaderMenu" IsTabStop="False" Style="{DynamicResource {dxt:DXTabControlThemeKey ResourceKey=HeaderMenuStyle}}" 
                           Margin="{DynamicResource {dxt:DXTabControlInternalThemeKey ResourceKey=ComponentsSpaceForHorizontalLayouts}}" />-->
                    <Controls:HeaderMenuForDXTabControl Grid.Column="3" 
                                    x:Name="HeaderMenu"
                                    IsTabStop="False" 
                                    Style="{DynamicResource {dxt:DXTabControlThemeKey ResourceKey=HeaderMenuStyle}}" 
                                    Margin="{DynamicResource {dxt:DXTabControlInternalThemeKey ResourceKey=ComponentsSpaceForHorizontalLayouts}}" />
                </Grid>
                <Grid Grid.Row="1">
                    <dx:DXContentPresenter  ContentTemplate="{DynamicResource {dxt:DXTabControlThemeKey ResourceKey=BackgroundTemplate}}" IsTabStop="False">

                    </dx:DXContentPresenter>
                    <Grid Margin="1">
                        <dx:DXContentPresenter x:Name="contentPresenter" Margin="{TemplateBinding Padding}" UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
                                   Content="{TemplateBinding SelectedItemContent}" ContentTemplate="{TemplateBinding SelectedItemContentTemplate}">

                            <KeyboardNavigation.TabNavigation>Local</KeyboardNavigation.TabNavigation>
                            <KeyboardNavigation.DirectionalNavigation>Contained</KeyboardNavigation.DirectionalNavigation>
                            <KeyboardNavigation.TabIndex>2</KeyboardNavigation.TabIndex>

                        </dx:DXContentPresenter>
                        <dx:TabControlFastRenderPanel x:Name="fastRenderPanel" Margin="{TemplateBinding Padding}" UseLayoutRounding="{TemplateBinding UseLayoutRounding}" Visibility="Collapsed">

                            <KeyboardNavigation.TabNavigation>Local</KeyboardNavigation.TabNavigation>
                            <KeyboardNavigation.DirectionalNavigation>Contained</KeyboardNavigation.DirectionalNavigation>
                            <KeyboardNavigation.TabIndex>2</KeyboardNavigation.TabIndex>

                        </dx:TabControlFastRenderPanel>
                    </Grid>
                </Grid>
            </Grid>
        </ControlTemplate>
    </ResourceDictionary>        
</Window.Resources>
<Grid>
    <Grid Visibility="{Binding ShowProgress, Converter={StaticResource negativeBoolToVis}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>                
        </Grid.RowDefinitions>            
        <Grid Grid.Row="0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="65"></RowDefinition>                
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="Auto" MinWidth="2"></ColumnDefinition>               
        </Grid.ColumnDefinitions>

            <Image Grid.Row ="0" Height="37" Width="174" Margin="11,6,0,0" 
                   Name="image1" Stretch="Fill" VerticalAlignment="Top" 
                   HorizontalAlignment="Left" 
                   Source="/MstarCommodityWPFLib;component/Resources/MorningstarLogo_Red.gif" />

            <Border  Grid.ColumnSpan="1" Grid.Row="0" HorizontalAlignment="Right" Margin="0,10,0,0" 
                     Height="50" Width="400" Background="white" BorderThickness="1" BorderBrush="White"  >
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="23"/>
                        <RowDefinition Height="4"/>
                        <RowDefinition Height="23"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                    <ContentControl Content="{Binding Path=SearchBox}" Margin="0 0 5 0" />
                    <TextBlock Grid.Row="0" Grid.Column="1"> 
                    <Hyperlink Click="ShowSettings" TextDecorations="None">
                        <Image Source="{Binding ConfigImageFilePath}"  ></Image>
                    </Hyperlink>
                    </TextBlock>
                    <TextBlock Grid.Row="2" Grid.Column="1"> 
                    <Hyperlink Click="HelpHyperlinkClick"> 
                        <Image Source="{Binding HelpIconFilePath}"></Image>
                    </Hyperlink>
                    </TextBlock>
                </Grid>
            </Border>                
        </Grid>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Name="columnWidth" MaxWidth="350"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid x:Name="horizontalGrid">                
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" MinHeight="125"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Name="rowHeight" MinHeight="150"></RowDefinition>
                </Grid.RowDefinitions>

                <dx:DXTabControl Grid.Row="0"  
                    Margin="10 0 5 5"
                    Name="MainTabRegion"  
                    SelectedIndex="{Binding Tabs.SelectedIndex}" 
                    ItemsSource="{Binding Tabs.TabItems}"  
                    DestroyContentOnTabSwitching="False" BorderThickness="5"                          
                    OverridesDefaultStyle="True">
                    <dx:DXTabControl.View>
                        <dx:TabControlScrollView 
                                     ShowHeaderMenu="True"  
                                     AllowHideTabItems="True" 
                                     CloseHeaderMenuOnItemSelecting="True" ShowHiddenTabItemsInHeaderMenu="True" />
                    </dx:DXTabControl.View>

                    <dx:DXTabControl.ItemContainerStyle>
                        <Style TargetType="{x:Type dx:DXTabItem}">
                            <Setter Property="Visibility" Value="{Binding IsVisible, Mode=OneWay, Converter={StaticResource boolToVis}}"/>
                        </Style>
                    </dx:DXTabControl.ItemContainerStyle>
                    <dx:DXTabControl.ItemHeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Header}" 
                                        Visibility="{Binding IsVisible, Mode=OneWay, Converter={StaticResource boolToVis}}"
                                        OverridesDefaultStyle="True" />
                        </DataTemplate>
                    </dx:DXTabControl.ItemHeaderTemplate>
                </dx:DXTabControl>

                <GridSplitter  Grid.Row="1" 
                  Margin="10 0 5 5"
                  HorizontalAlignment="Stretch" 
                  VerticalAlignment="Stretch"              
                  ShowsPreview="true"
                  ResizeDirection="Rows"                      
                  Height="5" />
                <Border Grid.Row="2" Margin="10 0 5 5">
                    <ContentControl Content="{Binding Path=Basket}" />
                </Border>
            </Grid>

            <GridSplitter Margin="0 20 0 0" Grid.Column="1"
              HorizontalAlignment="Stretch" 
              VerticalAlignment="Stretch"              
              ShowsPreview="true"
              ResizeDirection="Columns"
              x:Name="verticalSplitter"                    
              DragCompleted="OnDragCompleted"
              Width="5" />                

             <Border Grid.RowSpan="3" Grid.Column="2"  Margin="3 20 0 0">
                    <ContentControl Content="{Binding Path=ColumnDataPreview}" />
             </Border>

        </Grid>

    </Grid>
    <Grid Height="25" Width="300" Visibility="{Binding ShowProgress, Converter={StaticResource boolToVis}}">
        <ProgressBar IsIndeterminate="True" Orientation="Horizontal" />
        <Viewbox>
            <TextBlock Text="Loading ..." Padding="50 0"/>
        </Viewbox>
    </Grid>
</Grid>

4

1 に答える 1