我是COM PORT的新手,我想从体重秤读取数据并显示在public partial class MainWindow : Window, INotifyPropertyChanged
{
public DataTemplate DataTemplate
{
get {
var myFactory = new FrameworkElementFactory(typeof(TextBlock));
myFactory.SetBinding(TextBlock.TextProperty, new Binding(".")); //bind to the DataContext
return new DataTemplate() { VisualTree = myFactory };
}
}
private object _dctx = new object(); //set the Dxtc property somewhere
public object Dctx
{
get { return _dctx; }
set { _dctx = value; RaisePropertyChanged(); }
}
public MainWindow()
{
InitializeComponent();
DataContext = this;
}
public event PropertyChangedEventHandler PropertyChanged;
public void RaisePropertyChanged([CallerMemberName]string caller = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(caller));
}
}
中。
我能够获取数据,但是它一直在运行(流式传输)。
我只想显示更改的内容。
我的代码:
@Override
public int getItemViewType(int position) {}