Code
var client = new HttpClient(); | |
var string1 = client.GetStringAsync("https://podcast.rthk.hk/podcast/novamanage.xml").Result; | |
// deserailize |
For using the PieChart, that is very easy, you just need to bind the series collection
Then I just need to get the data from my repo:
var categories = new ObservableCollection(_database.BudgetCategories.GetAllCategories());
SeriesCollection = new SeriesCollection();
foreach (var category in categories)
{
var budgetItems = new ObservableCollection(_database.BudgetItems.GetItemByCategory(category));
double amount = 0;
foreach (var item in budgetItems)
{
amount += (double) item.Amount;
}
var pieSeries = new PieSeries
{
Title = category.Name,
Values = new ChartValues { new ObservableValue(amount) },
DataLabels = true
};
SeriesCollection.Add(pieSeries);
}
}
]]>This is not a newly released phone. Thus, I did the long-term usage review. I have used that phone for about 8 Months. Generally, that is very happy. I brought the photo during two local trips. I used it as the primary camera for photos and video.
Actually, I bought this phone for photo taking. It has 50MP Camera. That is not bad. Moreover, it has Hasselblad-Branded Triple Camera Units. You can shoot the photo in Hasselblad color tone. Furthermore, it has A.I. Mode. I found it will tune the color, even it is better than your eyes. I got the feeling, it is a bit faked.
It has marisilicon X imaging npu. That is good for low light photography. I found it can enhance the light a lot.
I did not buy that for gaming purposes, although it should a good performance for gaming. Snapdragon 8 Gen 1 CPU and 12GB Ram, that is very good,
That is a flagship phone released on 2022, and the price around $800. I think that is a very value-for-money phone
Two months ago, I lost my internet connection. The first thing I thought about was that my internet provider got an outage in my area. After I contacted my provider via online chat, there was no outage in my area. At first, I believed my provider was declining after I checked my NBN box at the house after it fell after I touched it. The cable attached at the back was loose. I discovered that the cable had been chewed. I grew up in a city filled with high-rise buildings. It's tough to believe that an internet outage could be caused by an animal chewing on the cable. Also, I had a humorous idea - is the optical cable tasty?
]]>Recently, we have been buying a WPF application. That is a budget management application. That is talking about money. Of course, charts need to play an important role. I have looked into various charting libraries. Some of them need to be paid. However, one is entirely open and completed under an MIT license. That does not require access to their AP. Charting is done locally. It supports everything, such as MAUI, Wpf, Winforms, and ASP.net. In addition, the documentation is alright. That is Live Charts.
]]>I found that the ComboBox WPF binding in WPF does not work correctly if the binding value is of an object type. Even when I set SelectedValuePath="Id", the binding fails to set the value. When a different value in the ComboBox is selected, the new selected value should be set in the ViewModel too. However, this does not happen this way.
I got a solution for this issue, which is to set the SelectedValue to be the CategoryId:
<ComboBox Grid.Row="3" Grid.Column="1" ItemsSource="{Binding CategoryList}" DisplayMemberPath="Name" SelectedItem="CategoryId" SelectedValue="{Binding CategoryId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValuePath="Id" Margin="5"/>
Inside the ViewModel:
public int CategoryId { get => _selectedCategoryId; set { if (_selectedCategoryId != value) { //_selectedCategory = value; _item.CategoryId = value; _item.Category = CategoryList.FirstOrDefault(c => c.Id == value); OnPropertyChanged(); } } }
Then it will work!
]]>