分类: 开发

  • wpf 绑定ListViewItem

    Wpf 绑定ListViewItem 中的控件 Command 到 ViewModel :

    1. 给Window​ ** 定义名字:**

     <Window x:Name= "ThisWnd" >
    
    

    在绑定时找到指定名字

     <ListView>
     
         <ListView.ItemTemplate>
     
             <DataTemplate>
     
                 <Button Command= "{Binding ElementName=ThisWnd, Path=DataContext.CallCommand}" 
                 Text={Binding Name}></Button>
    
    

    2. 相对路径查找

    另一种方式是根据类型或层次查找

     <ListView>
     
         <ListView.ItemTemplate>
     
             <DataTemplate>
     
                 <Button Command= "{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListView}}, Path=DataContext.CallCommand}" 
                 Text={Binding Name}></Button>
     
     
    
    
  • xmake 配置代理

    Network Optimization | Xmake

    xmake下载库时,默认不使用代理,所以经常下载失败,需要手动配置代理:

    xmake g --proxy="socks5://127.0.0.1:33211"
    

    3312 是我使用的vpn的默认端口

    也可以配置 github镜像,我没使用这个方法。

    Network Optimization | Xmake