小编Dzy*_*ann的帖子

如何在网格中设置列的右边框?

我有一个像这样的网格:

<Grid>     
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="4*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>


        <TextBlock Grid.Row="0" Grid.Column="0">Row 0, Column 1</TextBlock>
        <TextBlock Grid.Row="1" Grid.Column="0">Row 1, Column 1</TextBlock>
        <TextBlock Grid.Row="2" Grid.Column="0">Row 2, Column 1</TextBlock>
        <TextBlock Grid.Row="3" Grid.Column="0">Row 3, Column 1</TextBlock>

        <TextBlock Grid.Row="0" Grid.Column="1" Grid.RowSpan="4">Column 1</TextBlock>
    </Grid>
Run Code Online (Sandbox Code Playgroud)

我不会在实际应用程序中实际使用TexBlocks,我用它们来使示例更容易.基本上我想设置从第1列中删除第0列中所有内容的边框.

你是怎样做的?

wpf xaml

8
推荐指数
1
解决办法
1万
查看次数

在Visual Studio 2012中,Librarian和Linker有什么区别?

我正在配置我的项目以使用x86和x64位进行构建,为了做到这一点,我必须为不同的配置更改目标机器.

我试图找到为我的Native C++库设置目标机器的位置,我找到了这篇文章.

但是我在Native C++ Library项目中没有链接器,我只在C++/CLI项目中有"配置属性 - > 链接器 - >高级 - >目标机器"选项.

在Native C++ Library项目中,我有一个" Librarian "部分.我搜索了一下,发现目标机器位于:配置属性 - > 图书馆员 - >常规 - >目标机器.

图书管理员部分的选项似乎比Linker少.

图书馆链接器部分一样吗?在我在谷歌搜索的文档我只看到链接器提到.

也许我配错了什么?或者在这篇文章中答案没有提到Native C++?

c++ c++-cli visual-studio-2012

8
推荐指数
1
解决办法
3577
查看次数

在xaml中使用自定义RoutedUICommand会引发异常

我按照这个文章和其他一些人来创建自定义RoutedUICommand.我正在使用Infragistics Ribbon,但我不认为问题来自那里.

<igRibbon:XamRibbonWindow x:Class="MyRibbonWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:igRibbon="http://infragistics.com/Ribbon"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:MyNamespaceTag="clr-namespace:MyNamespace"
xmlns:igWPF="http://schemas.infragistics.com/xaml/wpf" mc:Ignorable="d" 
WindowState="Maximized">    
<igRibbon:XamRibbonWindow.Resources>
<!-- Some DataTempaltes here -->
</igRibbon:XamRibbonWindow.Resources>
<igRibbon:RibbonWindowContentHost x:Name="ribbonWindowContentHost" >
  <igRibbon:RibbonWindowContentHost.Ribbon>
    <igRibbon:XamRibbon x:Name="xamRibbon" Theme="[current]">
      <igRibbon:XamRibbon.ApplicationMenu>
        <igRibbon:ApplicationMenu>
          <igRibbon:ApplicationMenu.FooterToolbar>
            <igRibbon:ApplicationMenuFooterToolbar>
              <igRibbon:ButtonTool Name="appMenuOptions" Caption="Opt_ions"/>
            </igRibbon:ApplicationMenuFooterToolbar>
           </igRibbon:ApplicationMenu.FooterToolbar>
      </igRibbon:ApplicationMenu>
    </igRibbon:XamRibbon.ApplicationMenu>
   </igRibbon:XamRibbon>
  </igRibbon:RibbonWindowContentHost.Ribbon>       
  <ContentControl Content="{Binding MyContent}"
      ContentTemplateSelector="{StaticResource myContentTemplateSelector}" />       
</igRibbon:RibbonWindowContentHost>    
</igRibbon:XamRibbonWindow>
Run Code Online (Sandbox Code Playgroud)

我们需要改变Infragistics Ribbon的外观和感觉,Infragistics社区的团队成员建议添加Style.问题是,当我们将它添加到功能区的"资源"部分时,它不起作用.所以我们被迫做了以下事情:

var resourceDictionary = new ResourceDictionary();
resourceDictionary.Source = new Uri(
    @"/MyNamespace;component/Resources/RibbonResources.xaml", 
    UriKind.RelativeOrAbsolute);
xamRibbon.Resources.MergedDictionaries.Add(resourceDictionary);
Run Code Online (Sandbox Code Playgroud)

这适用于功能区中的样式,但在RibbonResources.xaml中我们有一个按钮:

<Button Name="myButton" 
    Command="MyNamespaceTag:MyCommands.MyCommand" 
    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
    <Image Source="MyImage.png" Width="16" Height="16" />
</Button>
Run Code Online (Sandbox Code Playgroud)

MyCommand和MyCommands类的创建完全与我提到的文章一样.但是当我运行应用程序时,我收到以下错误:

XamlParseException:无法从文本MyNamespace创建"命令":MyCommands.MyCommand'InstoutException:类型引用找不到名为'{clr-namespace:MyNamespace} MyCommands'的类型. …

c# wpf xaml

6
推荐指数
1
解决办法
669
查看次数

在设置先决条件导入之前,无法调用GetExportedValue

我们在WPF应用程序中使用MEF.

我们收到此错误:

之前前提进口"MyNamespace.MyMainClass..ctor(参数='myParameter’,ContractName ='IContractInterface’)"已设置GetExportedValue不能叫.

没有使用线程,我有时会读到这个错误发生在多个线程上,但是以防万一我创建了组合容器,传递了"thread safe"参数为true

var container = new CompositionContainer(catalog, true);
Run Code Online (Sandbox Code Playgroud)

的守则是:

我的简化主类代码是:(的想法是,如果没有导入的IMySubClass,我将使用一个默认的实现,这就是为什么我对"OmImportsSatisfied"方法来创建它,满足它的进口.)

MyMainClass C#

[Export(typeof(IMyInterface)]
public class MyMainClass: IPartImportsSatisfiedNotification, IMyInterface
{
    [Import]
    public IContainer Container { get; private set; }

    [Import(AllowDefault = true)]
    public IMySubClass MySubClass { get; set; }

    [ImportingConstructor]
    public MyMainClass([Import(AllowDefault = true)] IContractInterface myParameter= null)
        : this()
    {
        if (myParameter!= null)
        {
            //Do Something with myParameter
        }            
    }

    public void OnImportsSatisfied()
    {
        if (MySubClass == …
Run Code Online (Sandbox Code Playgroud)

c# mef

6
推荐指数
1
解决办法
1867
查看次数

依赖属性的设计时数据?

我正在构建一个UserControl具有多个DependencyProperties用于控件 XAML 绑定的对象。

当我使用 MVVM 时,我通常会创建一个设计时 ViewModel,因为我发现这样可以更轻松地设置我的视图布局,而无需运行应用程序。

有没有办法design time在 UserControl 中为我的依赖属性设置数据?

wpf xaml user-controls dependency-properties mvvm

6
推荐指数
1
解决办法
825
查看次数

如何用Eclipse打开现有的C++项目?

我有两个C++项目,我需要在Windows和Linux中运行和构建.我们使用Microsoft TFS进行源代码管理.

  • 对于Windows,我们使用的是Visual Studio.
  • 对于Linux,我们使用的是Eclipse.(我对Eclipse没有太多经验)

我曾设法在两个平台上正确配置和构建项目.

我在TFS中检查了eclipse中的.cproject.project,所以我可以在另一台计算机上使用它.

现在我试图让项目在另一台Linux计算机上,我不知道该怎么做.

我尝试按照此说明操作,但我没有压缩源代码.

这里的其他地方建议创建一个新项目.

是否有办法在Eclipse中打开类似于Visual Studio的现有项目?

我是否必须创建一个新项目?如果是这样,我如何保持我所做的配置能够构建项目,以便其他开发人员可以使用它们?

c++ eclipse

6
推荐指数
1
解决办法
2万
查看次数

为什么我的隐式ContextMenu样式不会覆盖TextBox上下文菜单样式?

ContextMenu这个网站上获取了这种隐式样式:

<Application.Resources>
        <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
        <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />

        <Style TargetType="ContextMenu">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
            <Setter Property="HasDropShadow" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ContextMenu">
                        <Border 
          Name="Border"
          Background="{StaticResource WindowBackgroundBrush}"
          BorderBrush="{StaticResource SolidBorderBrush}"
          BorderThickness="1" >
                            <StackPanel IsItemsHost="True"
                      KeyboardNavigation.DirectionalNavigation="Cycle"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="HasDropShadow" Value="true">
                                <Setter TargetName="Border" Property="Padding" Value="0,3,0,3"/>
                                <Setter TargetName="Border" Property="CornerRadius" Value="4"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>
Run Code Online (Sandbox Code Playgroud)

然后,我努力让武功既应用在默认情况下,在这里使用ContextMenuTextBoxContextMenu增加了我的我Button

</Window.Resources>
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <TextBox …
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml

5
推荐指数
1
解决办法
359
查看次数

尝试向 C++/CLI 项目添加资源时拒绝访问

我正在尝试向我的 C++/CLI 项目添加资源。我正在使用 Visual Studio 2012。TFS 2013。

  • 右键单击项目 => 添加 => 资源 => 我收到错误消息。

错误:

操作无法完成。访问被拒绝。

我不明白为什么我会收到这个错误。我不知道如何修复它。迄今为止:

  • 我检出了整个项目(项目及其所有文件)
  • 我删除了文件夹和其中所有文件的“只读”标记。

我可以添加其他文件并编辑所有内容,但由于某种原因我无法添加资源。

我可以在记事本中编辑资源文件,所以我不知道还能做什么。(我什至重新启动以防万一)。

我可以将资源添加到我在同一个项目中拥有的 C++ 本机库。

还有什么可能导致此错误?

c++-cli visual-studio-2012

4
推荐指数
1
解决办法
2614
查看次数

为什么Oracle汇总了少于38位有效数字的数字?

我们有Oracle Server 10.2.

为了测试这个,我有一个非常简单的表.

CREATE TABLE MYSCHEMA.TESTNUMBER
(
  TESTNUMBER  NUMBER
)
Run Code Online (Sandbox Code Playgroud)

当我尝试插入0.98692326671601283时,数字会被四舍五入.

INSERT INTO MYSCHEMA.TESTNUMBER (TESTNUMBER) 
VALUES (0.98692326671601283);
Run Code Online (Sandbox Code Playgroud)

选择返回:

select * from TESTNUMBER
Run Code Online (Sandbox Code Playgroud)

0.98692326671601 3

它将最后3个数字"283"四舍五入为"3".

即使用TOAD UI查看它并尝试使用TOAD输入它,我也会得到相同的结果.为什么?是否可以在Oracle编号中插入此编号而不进行舍入?

oracle

4
推荐指数
1
解决办法
686
查看次数

如何从嵌套脚本换行到不同的文件?

是否可以从嵌套脚本换行到不同的文件?我有一个脚本调用另一个脚本.第一个脚本将所有内容假脱机到输出.我想只将第二个脚本的某些部分保存在不同的文件中.

但是当我在第二个脚本中停止假脱机时,它会完全停止,我不知道如何再次启动它以使其在第一个文件中继续假脱机.

例如,有这两个脚本,第二个选择到MY_TABLE不会被假脱机.

firstScript.sql

prompt --------------Start firstScript--------------
set pagesize 0
set heading on 
set feedback on 
set timing on
set time on
set echo on
set verify on

spool testFirstScript.sql

select DBMS_METADATA.GET_DDL('TABLE', 'MY_TABLE') from dual;

@secondScript.sql

select * from MY_TABLE where Id = 1; -- This doesn't get spooled.

spool off

prompt --------------End firstScript--------------
Run Code Online (Sandbox Code Playgroud)

secondScript.sql

prompt --------------Start secondScript--------------

spool testSecondScript.sql

select * from MY_TABLE;

spool off
prompt --------------End secondScript--------------
Run Code Online (Sandbox Code Playgroud)

线轴输出:

testFirstScript.sql

11:28:23 SQL> 
11:28:23 SQL> select DBMS_METADATA.GET_DDL('TABLE', 'MY_TABLE') from dual; …
Run Code Online (Sandbox Code Playgroud)

oracle sqlplus

4
推荐指数
1
解决办法
1756
查看次数