小编Rob*_*ter的帖子

C#WPF Combobox选择第一项

美好的一天,

我希望我的组合框能够选择其中的第一项.我正在使用C#和WPF.我从DataSet中读取数据.填充组合框:

DataTable sitesTable = clGast.SelectAll().Tables[0];
cbGastid.ItemsSource = sitesTable.DefaultView;
Run Code Online (Sandbox Code Playgroud)

组合框XAML代码:

<ComboBox 
   Name="cbGastid" 
   ItemsSource="{Binding}" 
   DisplayMemberPath="Description" 
   SelectedItem="{Binding Path=id}"
   IsSynchronizedWithCurrentItem="True" />
Run Code Online (Sandbox Code Playgroud)

如果我尝试:

cbGastid.SelectedIndex = 0; 
Run Code Online (Sandbox Code Playgroud)

它不起作用.

c# wpf xaml combobox dataset

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

Windows 8上的`msapplication-TileImage`的Favicon备份.

我有一个简单的是/否问题.

如果我不把它放在我的HTML文件中:

<meta name="msapplication-TileImage" content="favicon.png">
Run Code Online (Sandbox Code Playgroud)

Windows 8会自动使用此PNG:

<link rel="icon" href="favicon.png">
Run Code Online (Sandbox Code Playgroud)

我没有Windows 8机器来测试它.

favicon html5 windows-8

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

Angular View 绑定未使用简单布尔值更新

再见,这可能是一个菜鸟问题,但我无法让它发挥作用。

我有一个简单的服务,可以切换布尔值,如果布尔值为 true,则活动类应该出现在我的 div 上,如果为 false,则没有类......就这么简单。但是布尔值已更新,但我的视图没有对此做出反应。我是否必须以某种方式通知我的视图某些内容发生了变化?

服务:

import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class ClassToggleService {

    public menuActive = false;

    toggleMenu() {
      this.menuActive = !this.menuActive;
    }
}
Run Code Online (Sandbox Code Playgroud)

查看(左侧菜单组件):

 <div id="mainContainerRightTop" [class.active]="classToggleService.menuActive == true">
Run Code Online (Sandbox Code Playgroud)

切换点(顶部菜单组件):

<a id="hamburgerIcon" (click)="classToggleService.toggleMenu()">
Run Code Online (Sandbox Code Playgroud)

html binding view typescript angular

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

所选组件的角度显示标题

我的问题很简单。

我的结构

router-outlet例如/contact,在我显示我的页面中,/home/meetus

(如何)我可以在{{title}}?

这甚至可能还是我必须在每个组件内移动我的标题栏?

components title typescript angular

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

ASP.NET Core 登录 2 个不同的文件

将默认的 ASP.NET 核心日志记录与 Serilog 结合使用时,是否可以将错误写入 errors.log 并将信息写入 information.log

using Microsoft.Extensions.Logging;
using Serilog;

loggerFactory.AddSerilog();
loggerFactory.AddFile(Configuration.GetSection("Logging"));
Run Code Online (Sandbox Code Playgroud)

Appsettings.json:

"Logging": {
    "PathFormat": "path-{Date}.log",
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Information",
      "System": "Information",
      "Microsoft": "Information"
    }
  }
Run Code Online (Sandbox Code Playgroud)

我想要一个日志文件,我可以在其中查看已完成的请求以及诸如此类的内容,只是信息日志。和一个用于调试目的的错误日志。如何将不同的内容记录到 2 个文件中?

c# asp.net logging asp.net-core

3
推荐指数
1
解决办法
2613
查看次数

CSS HTML最后一个孩子不工作?

你好我想要在课堂上所有的thirth div:highLightBoxSmall有margin-right:0;

这是我的HTML:

        <a href="assortimentoverzicht.html"><div class="highLightBoxSmall"> <img src="images/style/HighLightAssortiment1.png" class="highLightsImg mid" /> <span class="highLightHeader">Monitoren</span></div></a>
        <a href="assortimentoverzicht.html"><div class="highLightBoxSmall"> <img src="images/style/HighLightAssortiment2.png" class="highLightsImg mid" /> <span class="highLightHeader">Monitoren</span></div></a>
        <a href="assortimentoverzicht.html"><div class="highLightBoxSmall"> <img src="images/style/HighLightAssortiment2.png" class="highLightsImg mid" /> <span class="highLightHeader">Monitoren</span></div></a>
        <a href="assortimentoverzicht.html"><div class="highLightBoxSmall"> <img src="images/style/HighLightAssortiment1.png" class="highLightsImg mid" /> <span class="highLightHeader">Monitoren</span></div></a>
        <a href="assortimentoverzicht.html"><div class="highLightBoxSmall"> <img src="images/style/HighLightAssortiment2.png" class="highLightsImg mid" /> <span class="highLightHeader">Monitoren</span></div></a>
        <a href="assortimentoverzicht.html"><div class="highLightBoxSmall"> <img src="images/style/HighLightAssortiment2.png" class="highLightsImg mid" /> <span class="highLightHeader">Monitoren</span></div></a>
        <a href="assortimentoverzicht.html"><div class="highLightBoxSmall"> <img src="images/style/HighLightAssortiment1.png" class="highLightsImg mid" /> <span class="highLightHeader">Monitoren</span></div></a>
        <a href="assortimentoverzicht.html"><div class="highLightBoxSmall"> <img src="images/style/HighLightAssortiment2.png" class="highLightsImg mid" …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery css-selectors

0
推荐指数
1
解决办法
139
查看次数