小编Tal*_*dan的帖子

为每个代码后面的附加属性添加DataBinding

我想为附加的Property添加每个Codebehind的DataBinding,并希望Canvas.Left在TextBox中显示该属性.如何添加此属性?

c# data-binding code-behind attached-properties

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

保存图像表单剪贴板

我想将winrt中的一个Image保存到文件夹中.但我发现没有办法.你能帮帮忙吗?

var dataPackage = Clipboard.GetContent();
            var t = await dataPackage.GetBitmapAsync();
            var t2 = await t.OpenReadAsync();
            t2.AsStream();
            t2.Seek(0);
            BitmapImage bitmapImage = new BitmapImage();
            bitmapImage.SetSource(t2);
            Image image = new Image();
            image.Source = bitmapImage;<
Run Code Online (Sandbox Code Playgroud)

c# clipboard image save windows-runtime

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

更新为角度5后出错:NgReduxRouter没有提供者

更新到Angular 5后,我的商店模块收到错误消息.Angular-Redux现在有7.1.0版本

未处理的Promise拒绝:StaticInjectorError(AppModule)[StoreModule - > NgReduxRouter]:StaticInjectorError(Platform:core)[StoreModule - > NgReduxRouter]:NullInjectorError:没有NgReduxRouter的提供者!; 区域:; 任务:Promise.then; 值:错误:StaticInjectorError(AppModule)[StoreModule - > NgReduxRouter]:
StaticInjectorError(Platform:core)[StoreModule - > NgReduxRouter]:NullInjectorError:没有NgReduxRouter的提供者!at _NullInjector.get [...]

在这里,您可以看到我的商店模块

import { NgModule, isDevMode } from '@angular/core';

// Angular-redux ecosystem stuff.
// @angular-redux/form and @angular-redux/router are optional
// extensions that sync form and route location state between
// our store and Angular.
import { NgReduxModule, NgRedux, DevToolsExtension } from '@angular-redux/store';
import { NgReduxRouterModule, NgReduxRouter } from '@angular-redux/router';
import { provideReduxForms } from '@angular-redux/form';

// The top-level reducers and …
Run Code Online (Sandbox Code Playgroud)

angular

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

更新到 .net 6 后管道无法工作

我已将我的网站更新为 .net 6。它也可以在本地运行。但是,我在 Azure DevOps 中的 yaml 管道不再运行。像这样的解决方案中的所有 .csproj 文件的发布步骤都存在错误。我不知道如何配置它应该使用.net 6。

C:\Program Files\dotnet\sdk\5.0.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0.  Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. [D:\a\1\s\04_Contracts\Contracts\Contracts.csproj]
##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
Run Code Online (Sandbox Code Playgroud)

这是发布的管道步骤。

- task: DotNetCoreCLI@2
  displayName: 'dotnet publish'
  inputs:
    command: publish
    publishWebProjects: false
    projects: '**/*.csproj'
    arguments: '-r linux-x64 --output $(build.artifactstagingdirectory)'
Run Code Online (Sandbox Code Playgroud)

pipeline azure-devops azure-pipelines azure-pipelines-yaml

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

如何从 Blazor 的数据库中获取经过身份验证的用户

我想显示当前登录用户的电子邮件地址。但我不知道,如何得到它。我搜索了很多小时,但一无所获。我找到了一些片段来获取名称,但没有片段可以获取其他字段,例如电子邮件或电话号码。此代码段中的用户没有从数据库中获取它的 ID。

@page "/"
@inject AuthenticationStateProvider AuthenticationStateProvider

<button @onclick="@LogUsername">Write user info to console</button>
<br />
<br />
@Message

@code {
    string Message = "";

    private async Task LogUsername()
    {
        var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
        var user = authState.User;

        if (user.Identity.IsAuthenticated)
        {
            Message = ($"{user.Identity.Name} is authenticated.");
        }
        else
        {
            Message = ("The user is NOT authenticated.");
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

asp.net-core blazor blazor-server-side

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