Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. WPF: Customizing the appearence of a window n XAML

WPF: Customizing the appearence of a window n XAML

Scheduled Pinned Locked Moved WPF
csharpwpfvisual-studiocomquestion
11 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pew_new
    wrote on last edited by
    #1

    Hello guys. I tried to replicate a code kindly provided in this WPF customizing the appearance of a window in XAML sample in C#, XAML for Visual Studio 2013[^] and had got fails. Could someone replicate this code and upload working one from MainWindow.xaml and from App.xaml? P.S. I'm using VS2015 Thanks in advance!

    OriginalGriffO Richard DeemingR 2 Replies Last reply
    0
    • P Pew_new

      Hello guys. I tried to replicate a code kindly provided in this WPF customizing the appearance of a window in XAML sample in C#, XAML for Visual Studio 2013[^] and had got fails. Could someone replicate this code and upload working one from MainWindow.xaml and from App.xaml? P.S. I'm using VS2015 Thanks in advance!

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      No. It doesn't quite work like that. We do not do your work for you. If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys. The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^] That's not the same thing as "have a quick google and give up if I can't find exactly the right code". So either pay someone to do it, or learn how to write it yourself. We aren't here to do it for you.

      Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      P 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        No. It doesn't quite work like that. We do not do your work for you. If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys. The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^] That's not the same thing as "have a quick google and give up if I can't find exactly the right code". So either pay someone to do it, or learn how to write it yourself. We aren't here to do it for you.

        Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

        P Offline
        P Offline
        Pew_new
        wrote on last edited by
        #3

        Talk of money? If I were Moderator I would ban such posts (where there are talks of money). Because it is a sure sign of soon dying of the resource. PostScriptum: One of the principles of Free Internet sounds right about "peanuts and useful monkeys". Otherwise, a resource will die. Hope this helps.

        OriginalGriffO 1 Reply Last reply
        0
        • P Pew_new

          Talk of money? If I were Moderator I would ban such posts (where there are talks of money). Because it is a sure sign of soon dying of the resource. PostScriptum: One of the principles of Free Internet sounds right about "peanuts and useful monkeys". Otherwise, a resource will die. Hope this helps.

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          We have a very firm policy on spam (and yes, I'm a moderator) and my post doesn't even come close to approaching it. You are demanding that someone here should do your work for you, and provide you the code. That isn't what we as a site are here for: it's your homework or your "paid work" (it doesn't matter which it is) and that means that it's your task, not ours. We are willing to help, but not to the extent of you getting rewarded for our effort! :laugh:

          Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          P 1 Reply Last reply
          0
          • P Pew_new

            Hello guys. I tried to replicate a code kindly provided in this WPF customizing the appearance of a window in XAML sample in C#, XAML for Visual Studio 2013[^] and had got fails. Could someone replicate this code and upload working one from MainWindow.xaml and from App.xaml? P.S. I'm using VS2015 Thanks in advance!

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            Perhaps if you tell us what problems you're having - the full details of the error, and the line it occurs on - then someone might be able to help you. Otherwise, you might want to take a look at a MahApps.Metro[^], which provides a relatively easy way to customize your WPF windows.


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            P 1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              We have a very firm policy on spam (and yes, I'm a moderator) and my post doesn't even come close to approaching it. You are demanding that someone here should do your work for you, and provide you the code. That isn't what we as a site are here for: it's your homework or your "paid work" (it doesn't matter which it is) and that means that it's your task, not ours. We are willing to help, but not to the extent of you getting rewarded for our effort! :laugh:

              Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

              P Offline
              P Offline
              Pew_new
              wrote on last edited by
              #6

              Here's my App.xaml

                      <Setter Property="WindowStyle" Value="None"/>
                      <Setter Property="AllowsTransparency" Value="True"/>
                      <Setter Property="MinWidth" Value="100"/>
                      <Setter Property="MinHeight" Value="46"/>
                      <!--CaptionHeight + ResizeBorderThickness \* 2-->
                      <Setter Property="Background" Value="Yellow"/>
                      <Setter Property="BorderBrush" Value="Green"/>
                      <Setter Property="BorderThickness" Value="5"/>
                      <Setter Property="Foreground" Value="DarkRed"/>
                      <Setter Property="Template" Value="{StaticResource WindowTemplate}"/>
              

              Here's my MainWindow.xaml

              I've got a fail in MainWindow.xaml where Style="{StaticResource RedWindow}" is highlighted in red. I understand that I have no RedWindow resource at all. However, what I need to do in this case. Thanks in advance!

              Richard DeemingR 1 Reply Last reply
              0
              • Richard DeemingR Richard Deeming

                Perhaps if you tell us what problems you're having - the full details of the error, and the line it occurs on - then someone might be able to help you. Otherwise, you might want to take a look at a MahApps.Metro[^], which provides a relatively easy way to customize your WPF windows.


                "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                P Offline
                P Offline
                Pew_new
                wrote on last edited by
                #7

                Richard, please look at my previous post. There are lots of details there! Just need to get this code working.

                1 Reply Last reply
                0
                • P Pew_new

                  Here's my App.xaml

                          <Setter Property="WindowStyle" Value="None"/>
                          <Setter Property="AllowsTransparency" Value="True"/>
                          <Setter Property="MinWidth" Value="100"/>
                          <Setter Property="MinHeight" Value="46"/>
                          <!--CaptionHeight + ResizeBorderThickness \* 2-->
                          <Setter Property="Background" Value="Yellow"/>
                          <Setter Property="BorderBrush" Value="Green"/>
                          <Setter Property="BorderThickness" Value="5"/>
                          <Setter Property="Foreground" Value="DarkRed"/>
                          <Setter Property="Template" Value="{StaticResource WindowTemplate}"/>
                  

                  Here's my MainWindow.xaml

                  I've got a fail in MainWindow.xaml where Style="{StaticResource RedWindow}" is highlighted in red. I understand that I have no RedWindow resource at all. However, what I need to do in this case. Thanks in advance!

                  Richard DeemingR Offline
                  Richard DeemingR Offline
                  Richard Deeming
                  wrote on last edited by
                  #8

                  Pew_new wrote:

                  <Style x:Key="CustomWindow"

                  Pew_new wrote:

                  Style="{StaticResource RedWindow}"

                  That's a mistake in the text of the sample you're following. The {StaticResource ...} key needs to match the <Style x:Key="..." key. Change the window style to:

                  Style="{StaticResource CustomWindow}"

                  Resources - The complete WPF tutorial[^]


                  "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                  "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                  P 1 Reply Last reply
                  0
                  • Richard DeemingR Richard Deeming

                    Pew_new wrote:

                    <Style x:Key="CustomWindow"

                    Pew_new wrote:

                    Style="{StaticResource RedWindow}"

                    That's a mistake in the text of the sample you're following. The {StaticResource ...} key needs to match the <Style x:Key="..." key. Change the window style to:

                    Style="{StaticResource CustomWindow}"

                    Resources - The complete WPF tutorial[^]


                    "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                    P Offline
                    P Offline
                    Pew_new
                    wrote on last edited by
                    #9

                    And I've got a fail in App.xaml right after changing to CustomWindow. Value="{StaticResource WindowTemplate}"/>

                    Richard DeemingR 1 Reply Last reply
                    0
                    • P Pew_new

                      And I've got a fail in App.xaml right after changing to CustomWindow. Value="{StaticResource WindowTemplate}"/>

                      Richard DeemingR Offline
                      Richard DeemingR Offline
                      Richard Deeming
                      wrote on last edited by
                      #10

                      That resource seems to be missing from the text of the code sample. You'll probably need to download the code to see it.


                      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                      P 1 Reply Last reply
                      0
                      • Richard DeemingR Richard Deeming

                        That resource seems to be missing from the text of the code sample. You'll probably need to download the code to see it.


                        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                        P Offline
                        P Offline
                        Pew_new
                        wrote on last edited by
                        #11

                        Ohh, I'm sorry. Just not familiar with MSDN site. I had to download entire project provided. :) There were lots of C Sharp code files, naive little boy Pew. :) Thank you Richard.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups