ColorPicker
ColorPicker
概要
機能
サンプル
設定
説明
このサンプルは、ColorPicker コントロールの基本的な使用方法を示します。
ソース
IndexController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.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
@using System.Drawing
@{
ClientSettingsModel settings = ViewBag.DemoSettingsModel;
}
<div>
<label>@Html.Raw(Resources.ColorPicker.Index_ColorPicker)</label>
@Html.C1().ColorPicker().Id(settings.ControlId).Palette(Color.Red, Color.Green, Color.Blue).Width(400)
</div>
@section Description{
@Html.Raw(Resources.ColorPicker.Index_Text0)
}
マニュアル