在wpf上没有onclick的关闭bootstrap js对话框

时间:2017-06-21 11:53:14

标签: jquery wpf bootstrap-modal bootstrap-4

我想关闭js模态,但无需点击

无需点击 我想点击wp​​f

中的关闭按钮

Open modal click in wpf image

我想点击WebBrowser

Open modal click in Web Browser image

任何模态都不会隐藏。模态开启但关闭选择而不点击wpf

JS MODAL

    <body>

    <div class="container">
      <h2>Activate Modal with JavaScript</h2>
      <!-- Trigger the modal with a button -->
      <button type="button" class="btn btn-info btn-lg" id="myBtn">Open Modal</button>

      <!-- Modal -->
      <div class="modal fade" id="myModal" role="dialog">
        <div class="modal-dialog">

          <!-- Modal content-->
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4 class="modal-title">Modal Header</h4>
            </div>
            <div class="modal-body">
              <p>Some text in the modal.</p>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
          </div>

        </div>
      </div>

    </div>

    <script>
    $(document).ready(function(){
        $("#myBtn").click(function(){
            $("#myModal").modal();
        });
    });
    </script>

    </body>
    </html>

WPF

public MainWindow()
{
    InitializeComponent();
    wbBrowser.Navigate(new Uri("http://localhost/AlertWebProject"));    
}

1 个答案:

答案 0 :(得分:0)

你可以创建一个新的js函数

npm install --save app-banner


import AppBanner from 'app-banner/src';

...
<div>
<AppBanner google="com.youcompany.yourapp" apple="id1234567890" 
position="bottom-left" />
</div>

并进入您的Web浏览器,您可以调用脚本函数。 在WPF中使用webbrowser调用js函数 How to communicate between WPF and JavaScript in a WebBrowser instance?