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
P

Pew_new

@Pew_new
About
Posts
24
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to use DataTrigger to run Storyboard?
    P Pew_new

    Helo everyone! I have a Storyboard at Window resources as shown below.

    The Storyboard can be started with the following string which is placed in regular Button.

    A question is How to use a data binding in order to start that Storyboard. For example:

    I've tried to put DataTrigger at different places and I had got nothing besides red squiggles and exception while debugging. Thanks in advance!

    WPF tutorial question wpf wcf

  • How to call "customized" mahapps.metro modal-dialog window?
    P Pew_new

    Hello everyone, I've tried to follow the steps described here: https://stackoverflow.com/questions/30751663/how-to-change-mahapps-metro-dialog-content-template-width Here, I can't understand by which way is called "newly customized" modal-dialog window. I've tried a way that was offered at mahapps home page. This way works and calls modal-dialog window as though there was nothing customized at all. In other words mahapps.modal window is called by default.

    private async void button_Click(object sender, RoutedEventArgs e)
    {
    await this.ShowMessageAsync("Attention", "The product is out of range");

        }
    

    Any ideas please?

    WPF com tutorial question

  • Please help me to figure out a purpose of this code.
    P Pew_new

    It may close this topic. I've got comrehensive answer from Mr.Holmes. If you're interested in. This is answer: It represents the number of milliseconds the system takes to complete the processing loop from the VM.

    WPF question wpf design regex architecture

  • Please help me to figure out a purpose of this code.
    P Pew_new

    Some info I gave in the first post: Timer -> Timer procedure and calculation -> MVVM pattern -> UI. As said Mr.Holmes. It's very simple code.:thumbsup:

    WPF question wpf design regex architecture

  • Please help me to figure out a purpose of this code.
    P Pew_new

    Richard MacCutchan> The question really is what this code is being used for? I would ask you this way. :) My guess is it provides an UI user some kind of "Warning". Something like "Your PC's processor is so busy that the ScanTime went out of allowed time range." Of course in case when value is out of tolerance "window". A value is out of tolerancee "window" - text of value is highlighted with red.

    WPF question wpf design regex architecture

  • Please help me to figure out a purpose of this code.
    P Pew_new

    Holmes> It represents the number of milliseconds the system takes to complete the processing loop from the VM. I was waiting for this sentence.:thumbsup: For what this stands for? I mean, e.g. a label with mentioned milliseconds inside, on UI screen. Just show to UI user that app is alive?

    WPF question wpf design regex architecture

  • Please help me to figure out a purpose of this code.
    P Pew_new

    @__Holmes__, my dear, oddly enough, I knew a structure of this code, like nobody's business. I asked a bit a different stuff. Let me repeat that: I wish I knew what we really have useful by substraction as follows: ScanTime = DateTime.Now - _lastScanTime?? When the code is running I have a quickly alterating value 250-270 ms. P.S. Next time, before replying, just try to read posts more carefully. As concerned books, please do me a favour, show me a book where is written for what it is being done by mentioned substraction. I'll be waiting for such useful book. Pew

    WPF question wpf design regex architecture

  • Please help me to figure out a purpose of this code.
    P Pew_new

    This is in a Class called ST:

    public Class ST
    {
    private readonly System.Timers.Timer _timer;
    private DateTime _lastScanTime;

    public ST()
    {

            \_timer = new System.Timers.Timer();
            \_timer.Interval = 250;
            \_timer.Start();
            \_timer.Elapsed += OnTimerElapsed;
        }
    
    
    
         public TimeSpan ScanTime { get; private set; }
    
          private void OnTimerElapsed(object sender, ElapsedEventArgs e)
        {
            try
            {
                \_timer.Stop();
                ScanTime = DateTime.Now - \_lastScanTime;
                
                OnValuesRefreshed();
            }
            finally
            {
                \_timer.Start();
            }
            \_lastScanTime = DateTime.Now;
        }
        
        private void OnValuesRefreshed()
        {
            ValuesRefreshed?.Invoke(this, new EventArgs());
        }
    

    }

    Then a value of Scantime is being transferred via MVVM pattern (ViewModel) to UI. The major question is what do we really have valuable when we do a substraction as follows: ScanTime = DateTime.Now - _lastScanTime? This point I can't figure out. Thanks in advance!

    WPF question wpf design regex architecture

  • Simpliest code: Can't change label "Content" programmatically
    P Pew_new

    Please explain where have you seen " different thread"? "different thread", you mean that with a System.Timer it's not possible? P.S. Here https://www.youtube.com/watch?v=QkT8fgoFz3g, a guy is doing that easily. True he's using a Dispatcher Timer. So what's difference?

    WPF wpf csharp question

  • Simpliest code: Can't change label "Content" programmatically
    P Pew_new

    Hello everyone. Currently I am trying to work with timers in WPF.

    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
    _timer = new System.Timers.Timer();
    _timer.Interval = 1000;
    _timer.Elapsed += OnTimerElapsed;
    _timer.Start();

        }
    
        int i=0;
        private void OnTimerElapsed(object sender, ElapsedEventArgs e)
        {
            i++;
    
            label1.Content = i.ToString();
    
        }
    

    I've got an exception at this string

    label1.Content = i.ToString();

    What I'm doing wrong with a label? Thanks in advance! XAML:

    WPF wpf csharp question

  • WPF: Customizing the appearence of a window n XAML
    P Pew_new

    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.

    WPF csharp wpf visual-studio com question

  • WPF: Customizing the appearence of a window n XAML
    P Pew_new

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

    WPF csharp wpf visual-studio com question

  • WPF: Customizing the appearence of a window n XAML
    P Pew_new

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

    WPF csharp wpf visual-studio com question

  • WPF: Customizing the appearence of a window n XAML
    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!

    WPF csharp wpf visual-studio com question

  • WPF: Customizing the appearence of a window n XAML
    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.

    WPF csharp wpf visual-studio com question

  • WPF: Customizing the appearence of a window n XAML
    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!

    WPF csharp wpf visual-studio com question

  • WPF: Can't get what I need to do to get things right (responsive controls).
    P Pew_new

    Gerry Schmitz> you approached it all wrong. OK, these words are just words. Could you show me correct approaches by means of uploading a working code (as it was done above, in previous posts). Let's suppose. It'll be "simpliest" task called " how to make Canvas to be fully adaptive/responsive to the range of resolutions e.g. 1024x768 ---> 1920x1080". Really have no clue how to do that by professional way. I would be much appreciated.

    WPF question csharp mobile wpf help

  • WPF: Can't get what I need to do to get things right (responsive controls).
    P Pew_new

    Richard>There's nothing "fake" about using a rectangle to fill the background of the row. It would be better if that Rectangle would help me to adapt a Canvas properly. :) I saw at least a few apps where Canvas was playing, so to speak, one of key roles and excellently adapted to the range of resolutions. From relatively older 1024x768 to modern 1920x1080. Unfortunately the history has no records by which way it was made.:confused: I've tried many variants of ViewBox/Canvas symbiosis and different Canvas aspect ratios, to no avail. Previously I thought that WPF (in contrast with WinForm) is more advanced stuff, at least in terms of adaptation/responsiveness. Now, I see it's not that.:thumbsdown: I guess there are ways to solve that. But they are not based on pure XAML.

    WPF question csharp mobile wpf help

  • WPF: Can't get what I need to do to get things right (responsive controls).
    P Pew_new

    Yes, agree. That's fake way. There's no canvas at fake colored places. :) I need overlapping of entire Row1.

    WPF question csharp mobile wpf help

  • WPF: Can't get what I need to do to get things right (responsive controls).
    P Pew_new

    I think that the case with rectangle isn't a way. I need overlapping of entire Row1 by Canvas. Because I'm going to use whole space of Row1, from left to right. True, I can't figure out what I need to do for that.

    WPF question csharp mobile wpf help
  • Login

  • Don't have an account? Register

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