mvvm

enable child control while Custom parent is disabled in wpf C#

爷,独闯天下 提交于 2021-02-04 08:36:05
问题 Hello I made custom made parent control for zooming Picture . Inside That Control there is child canvas and inside Canvas There is child image Control . And I created A menu for Zoom and Image measuring . I also can able to measure co Ordinates the image . My problem when I disabled Parent ZoomBorder control I cannot triggering event of Child Image . I can disable ZoomControl named ZoomBorder but I want image event of MouseDown . I can Disable child Image event when Zoomcontrol enabled and It

重磅!印度封禁59款中国APP!微信抖音微博均在列!

大憨熊 提交于 2021-01-30 13:48:52
点击上方“ 技术最TOP ”,星标公众号 重磅干货,第一时间送达 技术最TOP 扒最前沿科技动态,聊最TOP编程技术。 关注 昨夜,印度政府突然宣布将禁用59个应用,虽然公告没有明确此次行动针对中国企业,但遭到禁止的应用绝大部分为中国互联网企业所开发,包括Tiktok、微信、快手、百度地图、QQ音乐等诸多中国用户熟知的应用。 禁用这些应用的原因是它们“参与了损害印度主权和领土完整、国防、国家安全以及公共秩序的活动”。 这并不是印度的突然袭击,印度情报机构早前已经向政府请求封禁一批应用。这批名单中的53个疑似和中国有关,大部分和昨晚的名单一致,但线上会议软件Zoom、小米商店Mi Store等早前在列的应用,并未出现在29日的最终名单中。 01 深夜突发,印度封禁59款中国APP 在印度政府发布的公告里,重点提及此次针对移动应用的行动,是基于“国家安全”。公告认为, 被禁止的应用在收集用户数据方面没有符合有关规定。 印度采取行动的法律依据是什么呢?印度的信息技术部声称根据2000年《信息技术法》第69A条以及《2009年信息技术(阻止公众获取信息的程序和保障措施)规则》的相关规定来进行禁止的。 信息技术部称,“已经收到来自各种来源的许多投诉,其中包括关于滥用某些App的报道,这些信息是盗用并以未经授权的方式秘密地将用户数据传输到印度以外的服务器”,“电脑紧急应变小组(CERT-IN

Multiple ViewModels in same View

非 Y 不嫁゛ 提交于 2021-01-29 22:05:19
问题 I have several different ViewModels that I would like to display in the same view (MainPage.xaml). I'm new to this and don't know how to do it. I have tried to create a MainViewModel: public class MainViewModel : ViewModelBase, INotifyPropertyChanged { WeatherViewModel weatherView = new WeatherViewModel(); ForecastViewModel forecastViewModel = new ForecastViewModel(); DeparturesViewModel departuresViewModel = new DeparturesViewModel(); CalenderViewModel calenderViewModel = new

Wpf Multiple nested Usercontrols with MvvmCross

大城市里の小女人 提交于 2021-01-29 20:24:25
问题 I'm pretty new in MvvmCross but I'm working with mvvm for awhile. I know how to compose usercontrols with nested usercontrols. Now with mvvmcross I got stucked to show two or more usercontrols in another usercontrol. I don't use any other framework than MvvmCross . My Rootview looks like this: `<views:MvxWpfView x:Class="MvvmCrossTest.Wpf.Views.RootView" xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf" xmlns="http://schemas.microsoft.com/winfx/2006

Combo Box Selected Index -1 bound to Collection View Source

六眼飞鱼酱① 提交于 2021-01-29 17:56:45
问题 I've a ComboBox Bound To a CollectionViewSource and I want that by default the selected index should be -1 (Because nothing should be selected) I've set SelectedIndex="-1" and the first item is still selected. Why? My View xaml: <Window.Resources> <CollectionViewSource x:Key="States" Source="{Binding States}"/> <CollectionViewSource x:Key="Cities" Source="{Binding Source={StaticResource States}, Path=Cities}"/> </Window.Resources> <ComboBox SelectedValue="{Binding Person.State}" Width="150"

Binding to a COM Object - Cannot resolve a Property

左心房为你撑大大i 提交于 2021-01-29 17:46:33
问题 I am currently running into some trouble with binding objects to a WPF ListBox. The number of Elements is populated correctly but the Name property cannot be accessed. I get the following error message: System.Windows.Data Error: 40 : BindingExpression path error: 'Name' property not found on 'object' ''__ComObject' (HashCode=17252513)'. BindingExpression:Path=Name; DataItem='__ComObject' (HashCode=17252513); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')

Binding Command on dynamically loaded menuitem

送分小仙女□ 提交于 2021-01-29 17:27:05
问题 I am successfully populating a menuitem with a list of cars. I want each car in the menuitem to be able to fire a command "RemoveCarCommand". On a dynamically loaded menuitem of cars (or anything), I know I need to have the command assigned to each car that is in the menuitem, but I cannot figure out the XAML to do that. Can someone help? <MenuItem Header="Remove Car" ItemsSource="{Binding AvailableCars}"> <MenuItem.ItemContainerStyle> <Style> <Setter Property="MenuItem.Command" Value="

Binding from UI to view model property requires focus to be removed from the TextBox

孤人 提交于 2021-01-29 12:50:49
问题 I am using MVVM. I have a DataGrid which lists some airports. Now I have a textbox let the user to input some keywords to search for a particular airport so that the airport list will only display matched airports. private string airport; public string Airport { get { return airport; } //the following will not be executed unless the cursor is removed from the textbox set { airport = value; //OnPropertyChanged("Airport"); } } view: <TextBox x:Name="textBox_Airport" Text="{Binding Airport}"> <i

Bind Plugin.Media fromViewModel

本小妞迷上赌 提交于 2021-01-29 12:37:44
问题 I have a view model that handles the Plugin.Media to take a picture from the phone. The image will not show unless I have the code below (View Model) in the code-behind, then it works fine, which is defeating the object of me learning MVVM. I have also tried ' FileImageSource ' and used ' Source' in its various ways.' Can anyone explain what I am doing wrong? View Model: public string FilePath { get => _filepath; set { _filepath = value; OnPropertyChanged(); } } private string _filepath;

How to instantiate ViewModel that extends AndroidViewModel?

此生再无相见时 提交于 2021-01-29 12:28:56
问题 I'm following a tutorial where a ViewModel extends an abstract class in order to use coroutines, this is the class that extends: abstract class BaseViewModel(application: Application) : AndroidViewModel(application), CoroutineScope { private val job = Job() override val coroutineContext: CoroutineContext get() = job + Dispatchers.Main override fun onCleared() { super.onCleared() job.cancel() }} And this is the ViewModel: class ViewModel(application: Application) : BaseViewModel(application) {