For a XAML code, what code do you usually utilize to create a header to put your logo in?
Kinda a beginner however i'm a bit confused to how you can identify a header in your xaml where you can change it's color while also putting images of a logo in
18 Replies
You mean Image?
Yeah i'm trying to identify a header in my xaml so i can write a code where i can put a logo (an image) in
Could be that i have the wrong thought process for this and just have to put a retangle and put an image up top of it
Identify a header?
Kinda like a html lol, like i said i could have the wrong thought process
Just set the name of the control you want
x:Name="foo"
if WPF
However I recommend learning MVVM (design pattern), it has a learning curve thoughwell it would be simple <image ...>
but how u set it and how u write it depends on your layout and whether you're using code behind vc MVVM vs DataContext
for example, some people like removing the default window border and creating their own with windowchrome, while some people just use the application icon to the window icon to their logo
that would be different then setting a <image ..> control
Yeah that's where i was trying to get at, just explained a bit vague
like this one for example is an icon
so to set that one u simple have to give your Window an attribute
Icon="Icon1.ico"
and have ico be a content in your application set to copy if newer, u can also have it as resource the way to add it there would be slightly different
@Prince J is it that one that u want to change?Yes that's the one
ah ok so yeah all you have to do is add Icon it can be a png, an ico etc
as an exemple, but if u want to change the executable icon then it would be a different location
Thanks
yw just for completeness the application icon i.e.: this
u would have to right click your project then go to properties
then scroll all the way down to Package > General
there u will see Icon
this one is more strict and requires an actual ico file AFAIK
$close
Use the /close command to mark a forum thread as answered