PIXNET Logo登入

小賢的部落格

跳到主文

取之於網路、饋之於網路 ; 邊做邊學、用以致學
☕️ 請作者喝一杯咖啡

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 6月 30 週二 201514:28
  • [WPF] Xaml泛型

x:TypeArguments 可定義泛型,目前測試只有WPF可以 WinRT無法用於建構子 
 
 Xaml:
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(151)

  • 個人分類:WPF
▲top
  • 7月 06 週日 201419:25
  • WPF 將邏輯從View搬到ViewModel不使用Command

2
  在MVVM的架構下,通常為了將事件及邏輯從View的code behind(.cs檔)中搬離,會使用到Command,不過Command的建置作業比傳統的事件較為麻煩,在參考Blend 的WPF資料繫結應用程式專案及Google之後,發現不需使用Command而且還能跟原本的事件相容,並且搬移到ViewModel中!
 
  
(1) 在Xaml中, ListView新增SelectionChanged事件
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(1,075)

  • 個人分類:WPF
▲top
  • 11月 20 週三 201311:59
  • 透過Json.Net 快速轉換class to xml與反轉

初始化
Car car = new Car();
car.root = new Root();
car.root.list = new List();
car.root.name = "海德格";
car.root.data = "救我";
for (int f = 0; f < 10; f++)
{
car.root.list.Add(f.ToString());
}
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(1,852)

  • 個人分類:WPF
▲top
  • 11月 06 週三 201315:53
  • [WPF] C# 產生DataTemplate

FrameworkElementFactory wrapElement = new FrameworkElementFactory(typeof(WrapPanel));
ItemsPanelTemplate itemPanelDataTemplate = new ItemsPanelTemplate(wrapElement);
itemPanelDataTemplate.VisualTree = wrapElement;


myListbox = new ListBox()
{
Opacity = 1,
Visibility = System.Windows.Visibility.Visible,
Height = double.NaN,
Width = double.NaN,
ItemsPanel = itemPanelDataTemplate,
Background = null,
Foreground = null,
BorderBrush = null,
VerticalAlignment = VerticalAlignment.Bottom,
HorizontalAlignment = HorizontalAlignment.Center,
Margin = new Thickness(0, 0, 30, 0)
};

(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(100)

  • 個人分類:WPF
▲top
  • 11月 04 週一 201313:01
  • WPF Tap 事件

解決事件重複觸發的問題:
 
private void Close_TouchDown(object sender, TouchEventArgs e)
{
e.Handled = true;
FrameworkElement element = sender as FrameworkElement;
element.CaptureTouch(e.TouchDevice);
}

(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(95)

  • 個人分類:WPF
▲top
  • 5月 08 週日 201114:30
  • [C#] WPF的高速影像處理

gdi.png
private void button2_Click(object sender, RoutedEventArgs e)
{
WriteableBitmap writeableBitmap = new WriteableBitmap(bitmapImage);
int startTime = Environment.TickCount;

int width = bitmapImage.PixelWidth;
int height = bitmapImage.PixelHeight;
int stride = width * ((bitmapImage.Format.BitsPerPixel + 7) / 8);
byte[] pixel = new byte[height * stride];

writeableBitmap.CopyPixels(pixel, stride, 0);

Parallel.For(0, height, y =>
{
int x;

for (x = 0; x < stride; x++)
{
pixel[x + y * stride] = (byte)(255 - pixel[x + y * stride]);
}
});

writeableBitmap.WritePixels(new Int32Rect(0, 0, width, height), pixel, stride, 0);
image1.Source = writeableBitmap;

this.Title =(Environment.TickCount - startTime) + " ms";

//CroppedBitmap
}
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(1) 人氣(4,514)

  • 個人分類:WPF
▲top
1

文章搜尋

文章分類

  • AI (5)
  • iOS (243)
  • Android (16)
  • Flutter (1)
  • .NET MAUI (Xamarin) (18)
  • UWP (18)
  • Windows Universal App 8.1 (9)
  • Windows Store 8.0 App (8)
  • Windows Phone 7, 8.0/XNA (17)
  • Windows Mobile 6 (2)
  • Silverlight (1)
  • WPF (6)
  • CUDA (1)
  • C# (20)
  • C/C++ (1)
  • VB6 (2)
  • HTML 5 (2)
  • ASP.NET MVC (5)
  • Blender (11)
  • 硬體 (1)
  • 軟體 (2)
  • 心情生活 (19)
  • 超好聽的音樂 (15)
  • 當兵的甘苦談 (2)
  • 未分類文章 (1)

最新文章

  • 設定 Antigravity + Xcode 26.3 MCP Server
  • [Flutter] 學習資源
  • [Swift] Swift 6.2 改善開發者體驗
  • [iOS] 使用Github action包版
  • [iOS] 切換git branch自動pod install
  • [Xcode cloud] CI script 由 ChatGPT產生
  • [n8n] Docker n8n 使用本地whisper指令
  • [AI] 本地語音轉文字
  • [n8n] Docker 安裝n8n
  • [iOS] AI Assist 方案研究參考資料

熱門文章

  • (5,527)[C#] RGB、HSI色彩空間互轉要注意的地方
  • (5,435)[Android] 漸層色背景
  • (4,933)怒!! TQC真的太誇張
  • (2,859)[iOS] Mac下的檔案差異比對工具 - FileMerge
  • (1,994)[iOS] 取得App Store 的網址
  • (1,614)超好聽的音樂4(紀曉君-神話(Luxgen 汽車廣告歌曲)原住民歌曲)
  • (1,279)我的TQC後續發展...
  • (398)[Swift] FB SDK 4.11 實作程式碼
  • (263)[Blender] 水球練習
  • (55)WP8 PanoramaItem Horizontal Scroll Header

最新留言

  • [22/04/11] 訪客 於文章「Windows Vista, 7, 8以...」留言:
    原本在搜尋引擎找出一堆 Blog 文章,不知哪幾篇值得花時間...
  • [16/05/12] pop 於文章「[C#] WPF的高速影像處理...」留言:
    您好: 測試用Source Code下載的下載連結,似乎已...
  • [15/11/25] ** 於文章「解決 Visual Studio C# ...」留言:
    你好,我在使用visual studio 2015 VB中,...
  • [15/05/27] 訪客 於文章「[C#] RGB、HSI色彩空間互轉要注...」留言:
    你好 請問RGB 轉到 HSI 在轉回RGB後 每...
  • [15/05/19] GG 於文章「[Win7] 解決無法釘選(pin) 到...」留言:
    讚喔,感恩。...
  • [14/12/12] 花翔 於文章「使用WebClient 請求Http G...」發表了一則私密留言
  • [14/11/24] 唐依蕾 於文章「[C] 使用C語言重現Chrome 30...」留言:
    你好,我想請問這個廣告的背景樂和出處,你曉得嗎?...
  • [14/11/20] hoppy 於文章「在 EeePC 901 上裝 Windo...」留言:
    請問該如何安裝呢? 可否分享一下?...
  • [14/11/06] 花翔 於文章「開啟這學期的讀書之路!!...」發表了一則私密留言
  • [14/01/13] ann41129 於文章「[C#] 關於亂數產生的範圍...」發表了一則私密留言

參觀人氣

  • 本日人氣:
  • 累積人氣:

贊助作者