ColorPicker
ColorPicker
概要
機能
サンプル
設定
説明
このサンプルは、ColorPicker コントロールの基本的な使用方法を示します。
ソース
IndexController.cs
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using MvcExplorer.Models;
namespace MvcExplorer.Controllers
{
public partial class ColorPickerController : Controller
{
public ActionResult Index()
{
ViewBag.DemoSettings = true;
ViewBag.DemoSettingsModel = new ClientSettingsModel
{
Settings = CreateSettings()
};
return View();
}
private static IDictionary<string, object[]> CreateSettings()
{
var settings = new Dictionary<string, object[]>
{
{"ShowAlphaChannel", new object[]{true, false}},
{"ShowColorString", new object[]{false, true}}
};
return settings;
}
}
}
Index.cshtml
@{
ClientSettingsModel settings = ViewBag.DemoSettingsModel;
var palette = new List<string> { "Red", "Green", "Blue" };
}
<div>
<label>ColorPicker</label>
<c1-color-picker id="@settings.ControlId" palette="@palette" width="400px">
</c1-color-picker>
</div>
@section Description{
@Html.Raw(ColorPickerRes.Index_Text0)
}
マニュアル