Create a digital clock using only xaml code in wpf

后端 未结 2 1724
旧时难觅i
旧时难觅i 2021-01-27 22:54

I wonder if it is possible to create a digital clock in xaml using animation (without background code tags)

The analog clock can be realized by converting the current ti

2条回答
  •  礼貌的吻别
    2021-01-27 23:34

    I recommend you do it based on textblocks and a suitable font like this one:

    https://www.keshikan.net/fonts-e.html

    Your textblocks are bound to propertys that could be set by an async function calling 'DateTime.Now();' here is a XAML-Example:

                
                      
                        
                        
                            
                            :
                            
                            :
                            
                        
                        
                        
                            
                                
                            
                            
                            :
                            
                            :
                            
                        
                        
                        
                            
                            :
                            
                            :
                            
                        
                    
                
    

    it would be even easier using only one textblock and a string format but this example I already had lying around :)

提交回复
热议问题