Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
WPF勉強会 第4回 スタイルの初歩/WPFStudy4
Search
hachiilcane
March 01, 2022
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WPF勉強会 第4回 スタイルの初歩/WPFStudy4
WPF勉強会 第4回 スタイルの初歩
説明後に実演するライブコーディングのコードはこちら。
https://github.com/hachiilcane/WpfStudy
hachiilcane
March 01, 2022
More Decks by hachiilcane
See All by hachiilcane
機械学習勉強会01 1次関数での回帰分析/MLStudy01
hachiilcane
0
67
機械学習勉強会02 多項式近似と最小二乗法による推定/MLStudy02
hachiilcane
0
120
機械学習勉強会03 最急降下法/MLStudy03
hachiilcane
0
40
機械学習勉強会04 偏微分と連鎖律/MLStudy04
hachiilcane
0
45
機械学習勉強会05 パーセプトロン/MLStudy05
hachiilcane
0
45
機械学習勉強会06 ロジスティック回帰/MLStudy06
hachiilcane
0
59
機械学習勉強会07 ROC曲線/MLStudy07
hachiilcane
0
45
機械学習勉強会08 2次元入力3クラス分類/MLStudy08
hachiilcane
0
76
機械学習勉強会09 2層フィードフォワードニューラルネット/MLStudy09
hachiilcane
0
75
Other Decks in Programming
See All in Programming
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
AmebaブログはKMPから卒業します
kmars0605
0
190
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
150
sbt 2.0: takeoff
eed3si9n
0
160
気持ちぃ〜角丸 Squircle
ryu1013
0
310
Workers Cache を知る
syumai
0
360
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
phperだってパンチカードでコーディングしたい
o0h
PRO
0
330
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
590
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
730
A Tale of Four Properties
chriscoyier
163
24k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Designing for Timeless Needs
cassininazir
1
530
Scaling GitHub
holman
464
140k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Designing Experiences People Love
moore
143
24k
The Invisible Side of Design
smashingmag
301
52k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Transcript
WPFษڧձ ୈ̐ճ ελΠϧͷॳา
ࠓ֮͑ͯ΄͍͜͠ͱ ελΠϧͱCSSͷΑ͏ͳͷͰ͋Δ ఆٛͷॴͰద༻ൣғ͕ܾ·Δ x:Key͕͔͔͘ͳ͍͔Ͱશવҧ͏ ελΠϧʹλʔήοτ͕ඞਢʂ
ελΠϧͱ ͍͔ͭ͘ͷϓϩύςΟΛ·ͱΊͨͷ ݸผʹɺશମʹɺෳͷཁૉʹద༻͢ ΔͨΊͷศརͳํ๏ ͭ·ΓCSSతͳͷͰ͢
CSSͱࣅ͍ͯΔͱ͜Ζ ఆٛ͢ΔॴͰద༻ൣғ͕มΘΔ ผϑΝΠϧʢϦιʔεσΟΫγϣφϦʣ> Application > Window > Page > ύωϧʢGridͱ͔ʣ
> 1ͭͷ ίϯτϩʔϧ > Template ఆ͕͔ٛͿͬͨ߹࠷ޙʹએݴͨ͠΄͏͕উͭ ݟͨͱϩδοΫΛͰ͖Δ XAML͚ͩͰݟͨΛࣗ༝ʹม͑ΒΕΔ
StyleͰઃఆͰ͖Δͷ ϓϩύςΟ എܠ৭ͱ͔ɺઢͷଠ͞ͱ͔ TemplateϓϩύςΟʹControlTemplateΛηοτ͢Δ͜ͱͰ͖Δ طଘͷίϯτϩʔϧͷࢹ֮తߏɾಈ࡞Λ࠶ఆٛͰ͖Δຐվ ࣍ճѻ͍·͢ TriggerʢϓϩύςΟτϦΨʔʣ ͜ͷϓϩύςΟ͕͜ΕʹͳͬͨΒ͜ͷϓϩύςΟΛ͜ͷʹ͢Δ EventTrigger MouseEnterΠϕϯτ͕ൃੜͨ͠Β0.2ඵ͔͚ͯOpacityΛ0.8ʹ͢Δͱ͔
؆୯ͳྫ ඞͣTargetType͕ඞཁ C#͔ͩΒܕݫີͳͷͰ͢ <Page.Resources> <Style TargetType="Button"> <Setter Property="Background" Value="AliceBlue"/> <Setter
Property="FontSize" Value="14"/> </Style> </Page.Resources> <Grid> <UniformGrid> <Button Content="Button1"/> <Button Content="Button2"/> <Button Content="Button3"/> </UniformGrid> </Grid>
x:Keyଐੑॏཁʂ x:Keyଐੑ͕ແ͍ͱɺTargetTypeͰࢦఆͨ͠ܕશ෦ʹద༻ x:Keyଐੑ͕͋ΔͱɺͦͷΩʔΛࢦఆͨ͠ͷ͚͕ͩద ༻ <Page.Resources> <Style x:Key="BlueButtonStyle" TargetType="Button"> <Setter Property="Background"
Value="AliceBlue"/> <Setter Property="FontSize" Value="14"/> </Style> </Page.Resources> <Grid> <UniformGrid> <Button Content="Button1"/> <Button Content="Button2" Style="{StaticResource BlueButtonStyle}"/> <Button Content="Button3"/> </UniformGrid> </Grid>
BasedOnͰܧঝͰ͖·͢ ผͷελΠϧΛج ʹɺελΠϧͷՃ ͕Ͱ͖Δ <Page.Resources> <Style TargetType="Button"> <Setter Property="Background" Value="AliceBlue"/>
<Setter Property="FontSize" Value="14"/> </Style> <Style x:Key="AmazingButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"> <Setter Property="RenderTransform"> <Setter.Value> <RotateTransform Angle="10"/> </Setter.Value> </Setter> </Style> </Page.Resources> <Grid> <UniformGrid> <Button Content="Button1"/> <Button Content="Button2" Style="{StaticResource AmazingButtonStyle}"/> <Button Content="Button3"/> </UniformGrid> </Grid>
ελΠϧͱ࠶ར༻Λ తͱͨ͠ͷ XAMLϦιʔεͱ͍͏֓೦Ͱཧ ϦιʔεʹελΠϧʴϒϥγ ϦιʔεσΟΫγϣφϦͱ͍͏ผϑΝΠ ϧʹ͢ΔͱɺΞϓϦέʔγϣϯؒͰڞ ༗Ͱ͖Δ
ϒϥγϦιʔεʹ͠ͱ ͘ͱศར ͍ճ͕͠Ͱ͖ΔͷͰɺޙͰશମͷ৭ຯΛม ͍͑͢ Πϯελϯε͕1ݸͰࡁΉ <Page.Resources> <SolidColorBrush x:Key="ButtonBackColor" Color="AliceBlue"/> <Style
TargetType="{x:Type Button}"> <Setter Property="Background" Value="{StaticResource ButtonBackColor}"/> <Setter Property="FontSize" Value="14"/> </Style> </Page.Resources>
͔͠͠ͳΜ͔ͩΜͩݴͬ ͯ…… ελΠϧͷϝΠϯContentTemplate ࣍ճ͕ΜΓ·͠ΐ͏ʂ